← Back to team overview

oship-dev team mailing list archive

Automatic Python code generation [Re: adl2py fundamentals]

 

Hi, all:
I was checking the state-of-the-art of the OpenEHR XML representation (http://www.openehr.org/releases/1.0.1/its/XML-schema/index.html) and also reviewing the different XML modules available in Python to represent data (DOM, objectify, Elementtree, lxml etc) when I found this: http://www.rexx.com/~dkuhlman/generateDS.html -- a module that generates Python classes from XML schemas (XSD files). It's not exactly what we were looking for back then in April, but may be useful anyway. Please have a look at it when you have some time.
 Best regards,
Roberto.

Le 23.04.2009 21:55, Roberto Siqueira a écrit :
[...] By the way: generation of Python code using Python itself is what is called metaprogramming (http://en.wikipedia.org/wiki/Metaprogramming). It would be wonderful to find some sort of Python "metaprogrammer" ("disassembler" or "decompiler") library ready to use, don't you think? Unfortunately, the only ones I've found (up to now) are "low level" bytecode decompilers like: http://docs.python.org/library/dis.html , that are not capable to decompile "high level" objects like classes, mixins etc. In any case, I suppose that the small "helper class" described in: http://effbot.org/zone/python-code-generator.htm will have some utility here, as handling indentation can be very cumbersome, sometimes. [...]




Follow ups

References