Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save a directory and its files back into HydroShare #116

Open
amabdallah opened this issue Feb 1, 2018 · 1 comment
Open

Save a directory and its files back into HydroShare #116

amabdallah opened this issue Feb 1, 2018 · 1 comment

Comments

@amabdallah
Copy link

amabdallah commented Feb 1, 2018

Is there a way to save a folder back to HydroShare?

I tried to save the folder "HydraLib" which has lots of files inside that but it gave me this mixed meaning message and I thought to share it in case you guys could improve it

files = ['HydraLib','WaMDaM_Hydra.ipynb','WEAP_test3.xlsm']
image

@amabdallah
Copy link
Author

In an email conversation, Tony suggested this solution

This can be done by:

1.) zipping your directory from with your notebook:

import shutil      
shutil.make_archive('mydir', 'zip', [path to folder])

2.) saving the *.zip file to your resource, e.g:

files = ['mydir.zip','...', '...']
3.) unzip it from the HS resource edit page by right-clicking on the *.zip file .

This process can be automated using the REST api, but I haven’t had a chance to implement it in JH yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant