ivoa / vo-dml

VO-DML tooling and documents.
Creative Commons Attribution Share Alike 4.0 International
1 stars 1 forks source link

do python code generation #8

Open pahjbo opened 2 years ago

pahjbo commented 2 years ago

It would be good to have python code generation (to python dataclasses?) similarly to the java code generation. Care would have to be taken to match the XML and ORM capabilities to interoperate with the java equivalents.

Some inspiration could be taken from https://xsdata.readthedocs.io/en/v22.2/index.html for XML and https://www.sqlalchemy.org for ORM

pahjbo commented 1 year ago

some work on python generation has been started on the pythongen branch

pahjbo commented 1 year ago

this work has been merged back into the master branch as the initial task integration has been completed and does not conflict with any other development on master.

The python generation task is called vodmlPythonGenerate and the main functionality of the generation is done in the vo-dml2python.xsl XSLT.

The python generation is only a first attempt at generating dataclasses with no serialisation functionality, and as such is not yet advertised in the main documentation

pahjbo commented 1 year ago

https://docs.pydantic.dev/latest/ is another candidate library to use for the python implementation

pahjbo commented 11 months ago

an "alpha" level of python generation that is using xsdata and sqlAlchemy has been released in version 0.3.24 of the plugin - this is not interoperable with the Java version, and so the detailed representation is likely to be changed before this is regarded as "finished"