-
Notifications
You must be signed in to change notification settings - Fork 162
generate xlsx spreadsheet templates from a schema #110
Description
Given a schema S, generate an xsls file (or google sheet) with one sheet for each class C (or a user-selected subset).
Each tab will have a column C for each slot inferred to be applicable for C
If the range of a slot is an enum, constrain the possible values
By default only include ranges that are primitive, but make the configurable (e.g. mixs templates have values that are classes with a has_raw_value slot, cc @wdduncan )
This will use the existing generator framework. The python class will be generators.excel_template. use an existing one like jsonschemagen as code template
TBD: for ranges that are ontology classes, see if there is a way to configure for rightfield/populous
For ranges that are enums, use drop downs. (google sheets: https://support.google.com/docs/answer/186103?co=GENIE.Platform%3DDesktop&hl=en)
Additionally, create a data dictionary tab
TBD: library/framework
Do we have both google sheets and excel writers, or target one and generate from the other?
There are a few options, the main two seem to be
- https://openpyxl.readthedocs.io/
- https://xlsxwriter.readthedocs.io/
- native pandas support
I think native support is quite limited. I am not sure yet of the differences between the other two but am tending towards openpyxl
The validation support seems good
https://openpyxl.readthedocs.io/en/latest/validation.html
Some notes on existing frameworks:
- dropdown support
- https://stackoverflow.com/questions/51497731/openpyxl-is-it-possible-to-create-a-dropdown-menu-in-an-excel-sheet
- https://stackoverflow.com/questions/11937746/programatically-creating-a-xls-with-a-drop-down-cell-in-python