A Python 3.6+ package to manage Zenodo repositories.
.create_project()
: create a new project.upload_file()
: upload file to project.download_file()
: download a file from a project.delete_file()
: permanently removes a file from a project.get_urls_from_doi()
: returns the files urls for a given doipip install zenodopy==0.3.0
pip install -e git+https://github.com/lgloege/zenodopy.git#egg=zenodopy
~/.zenodo_token
using the following command.# zenodo token
{ echo 'ACCESS_TOKEN: your_access_token_here' } > ~/.zenodo_token
# sandbox.zenodo token
{ echo 'ACCESS_TOKEN-sandbox: your_access_token_here' } > ~/.zenodo_token
zenodopy
packageimport zenodopy
# always start by creating a Client object
zeno = zenodopy.Client(sandbox=True)
# list project id's associated to zenodo account
zeno.list_projects
# create a project
zeno.create_project(title="test_project", upload_type="other")
# your zeno object now points to this newly created project
# create a file to upload
with open("~/test_file.txt", "w+") as f:
f.write("Hello from zenodopy")
# upload file to zenodo
zeno.upload_file("~/test.file.txt")
# list files of project
zeno.list_files
# set project to other project id's
zeno.set_project("<id>")
# delete project
zeno._delete_project(dep_id="<id>")
This project is under active development. Here is a list of things that needs improvement:
asyncio
and aiohttp
to write async functions. This will speed up downloading multiple files.