datacontract-cli
datacontract-cli copied to clipboard
Support import / export to open-data-contract-standard-excel-template
https://github.com/datacontract/open-data-contract-standard-excel-template
should be importable and exportable for ODCS data contracts.
Hi, I would like to kindly work on this. I'd split this into 2, one for import and one for export.
import implemented in #746 by converting the import logic from Data Mesh Manager written in Kotlin to python.
@cornzyblack feel free to have a look.
@simonharrer sure, will have a look. Since the import has been done already in your PR, is it okay to start looking at the export bit?
The PR with the import has now been merged.
A quick one, for the export, is it okay to ignore the workbook styling?
I think it is worth the effort to handle good styling.
I would start by downloading the template https://github.com/datacontract/open-data-contract-standard-excel-template/raw/refs/heads/main/odcs-template.xlsx
And filling the fields (they have defined names), the same way they got imported.
An update on this, I am still working on it, and here is a video of my progress.
When the user runs export --format excel, the output is an Excel file saved in a location
https://github.com/user-attachments/assets/144a26d8-02a3-4423-b58e-b7c258aa46bb
Not sure if this applied, as the code excel vier might not render everything correctly:
The exporter should use the template initially from https://github.com/datacontract/open-data-contract-standard-excel-template/tree/main
And then fill out the fields using Named Fields, as in the importer.
To emphasize on this: the idea is that one can do a roundtrip export/import and it will restore the same YAML file as before.
Hi @jochenchrist, yes, I am using the template. The reason why it wasn't shown correctly in the video was cause I am using a VSCode extension that does not render the colours from the Excel template
@cornzyblack do you have a PR with the code in we could test please?
hi @pixie79 sure, here is draft PR: https://github.com/datacontract/datacontract-cli/pull/779
Thanks for that, It looks like a good start. I can see a bit of miss mapping between fields when I compare loading my YAML into the datacontract-editor compared to loading into the excel especially around Info / Terms and SLA sections.
It did however correctly create a tab for my table schema however, as I though might happen didn't get that far on it. It missed some of the property names, but then did manage to fill in the Required and description for them. It also put the type into the Business Name column which was a bit odd.
Happy to help test any updates, or if it helps I can get one of my team to help pair to work on the PR with you.
Hi @pixie79 thanks for the feedback, yeah it's still a work in progress and I haven't fully tested it yet, but I am very happy to pair with someone fron your team to work in this PR.
Hey @pixie79! I have been trying to continue work on it, but it's more involved than I expected, and I haven’t had the time to give it the attention it deserves. I am going to step back for now, but please feel free to take over it!