datacontract-cli icon indicating copy to clipboard operation
datacontract-cli copied to clipboard

Support import / export to open-data-contract-standard-excel-template

Open jochenchrist opened this issue 7 months ago • 15 comments

https://github.com/datacontract/open-data-contract-standard-excel-template

should be importable and exportable for ODCS data contracts.

jochenchrist avatar May 01 '25 19:05 jochenchrist

Hi, I would like to kindly work on this. I'd split this into 2, one for import and one for export.

cornzyblack avatar May 05 '25 05:05 cornzyblack

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 avatar May 06 '25 17:05 simonharrer

@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?

cornzyblack avatar May 06 '25 17:05 cornzyblack

The PR with the import has now been merged.

jochenchrist avatar May 07 '25 06:05 jochenchrist

A quick one, for the export, is it okay to ignore the workbook styling?

cornzyblack avatar May 12 '25 22:05 cornzyblack

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.

jochenchrist avatar May 13 '25 05:05 jochenchrist

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

cornzyblack avatar May 22 '25 07:05 cornzyblack

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.

jochenchrist avatar May 23 '25 09:05 jochenchrist

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.

simonharrer avatar May 23 '25 15:05 simonharrer

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 avatar May 27 '25 08:05 cornzyblack

@cornzyblack do you have a PR with the code in we could test please?

pixie79 avatar Jun 02 '25 12:06 pixie79

hi @pixie79 sure, here is draft PR: https://github.com/datacontract/datacontract-cli/pull/779

cornzyblack avatar Jun 02 '25 23:06 cornzyblack

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.

pixie79 avatar Jun 03 '25 07:06 pixie79

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.

cornzyblack avatar Jun 04 '25 06:06 cornzyblack

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!

cornzyblack avatar Jun 13 '25 13:06 cornzyblack