Goal : build Python classes for DDI4 with cogs input.
-
Get the latest release
-
pick ddi-lifecycle_alloutputs_...zip
-
extract
/json/jsonScheme.jsonfrom the zip -
Create a
datafolder on repo root -
Copy
jsonScheme.jsontodata/jsonScheme.json
- Copy the
config.yaml.templatetoconfig.yaml - Change the path and name of the jsonScheme.json file if needed.
From the repo root folder, execute
sh generate_model.sh
Output : ddi4Datamodel.py
ddi4-fromscratch.py is a small studyUnit example.
pydantic_test.py is a test that instantiates a Python DDI 4 data model class from a JSON serialisation of DDI 4 data.
utc-millisecfrom Duration in jsonScheme is not recognized and converted to a float- Basic inherited types (like strings) are not generated properly in jsonScheme. An issue has been submitted : ddialliance/ddimodel#56
- There is a problem in generated python classes in
ddi4Datamodel.py. ATypeproperty must be added manually. You can find theddi4DatamodelFixed.pyin the repo. TODO : generate classes and add the Type property afterwards
- Thibaud Ritzenthaler
- Vincent Benoit
- Oliver Lyttleton