ITC-CRIB / jupyter-fairly

A JupyterLab extension for seamless integration of Jupyter-based research environments and research data repositories.
https://fairly.readthedocs.io
MIT License
8 stars 3 forks source link

Design/jose interface implementation demo #22

Closed jurra closed 2 years ago

jurra commented 2 years ago

Hello @manuGil and @girgink. Here is the latest code I have got testing the interface implementation with 4TU.

Tests still need to be written for the upload methods. The simplest way to get started and testing the interface is by running this little snippets in the python terminal or ipython. Dont forget to setup for .env at the root of the project with the following infomation: FOURTU_TOKEN="" FOURTU_SANDBOX_TOKEN="" ZENODO_TOKEN=""

from jupyterfair.core.four_tu import *
dir = "./your/dir/path"
f = FourTuData()

f.create_archive("<your article name>")
f.upload_data_to_archive("20051858", f'{dir}/<file_name>')

I put this as a draft pull request as there is still more to improve when it comes to readability and documentation. Furthermore I want to also test how to archive an entire directory and/or directory tree.