Development Status
- 4 - Beta
Environment
- Console
Intended Audience
- Developers
Operating System
- OS Independent
Programming Language
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
Topic
- Software Development :: Libraries :: Python Modules
- Scientific/Engineering
PyZenodo
Pure Python wrapper for Zenodo REST API.
Allows upload / download of data from Zenodo.
Install
pip install pyzenodo3
Latest development
git clone https://github.com/scivision/pyzenodo3
pip install -e pyzenodo3
Usage
Here are several examples of using Zenodo from Python 3. All of them assume you have first:
import pyzenodo3
zen = pyzenodo3.Zenodo()
Upload file to Zenodo
-
Get a Zenodo
deposit:writeAPI Token. This token must remain private, NOT uploaded to GitHub, etc.! -
create a simple text file
mymeta.inicontaining title, author etc. (see the examplemeta.iniin this repo) -
upload file to Zenodo (myApiToken is the cut-n-pasted Zenodo API text token)
python upload_zenodo.py myApiToken mymeta.ini myfile.zip --use-sandbox
Note the --use-sandbox is to avoid making junk uploads while testing out.
Once you're sure things are working as intended, not using that flag uploads to "real" Zenodo permanently.
Find Zenodo record by Github repo
Rec = zen.find_record__by_github_repo('scivision/lowtran')
This Zenodo Record contains the metadata that can be further manipulated in a simple class containing the data in dictionaries, with a few future helper methods.
Find Zenodo records by Github username
Recs = zen.search('scivision')
Recs is a list of Zenodo Records for the GitHub username queried, as in the example above.
Notes
- We don't use
deposit:publishAPI token to keep a human-in-the-loop in case of hacking of sensor nodes.