ELN File Import #27
nicobrandt
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Yeah, I was thinking this too. Basically a lib so you feed it a path to a .eln and it gives you a python object with the json interpreted or something. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure how far everyone is yet with importing (let alone exporting) ELN files, so I thought I would share some code @jmanideep and me wrote for importing ELN files to Kadi4Mat as a reference: https://gitlab.com/iam-cms/kadi-apy/-/blob/develop/kadi_apy/lib/imports.py#L27
The import is currently done via the Kadi4Mat REST API using our Python wrapper library, although we might built it into the GUI/API directly eventually, at least for smaller crates. It is currently also limited to the very basic metadata that every ELN should probably be able to export. Some Kadi4Mat-specific things might be added as well later on based on some of the file contents, since in our case these can include exported JSON, RDF, etc.
The idea why I'm sharing this is that it might help others in their implementation or even facilitate the creation of common libraries in the future, as there are quite a few things and edge-cases that have to be considered, even when just focusing on the basics. You will notice this when looking at the excessive error handling we added in the code. Some of these aspects also came up in discussions with @NicolasCARPi (originally in #26), such as handling of certain file names. This is less of an issue when just running the import locally instead of on a server, but should still be taken into account.
Let us know what you think :)
Beta Was this translation helpful? Give feedback.
All reactions