Skip to main content

zenodopy

Tests codecov pypi License:MIT contributions welcome

Project under active deveopment, not production ready

A Python 3.6+ package to manage Zenodo repositories.

Functions Implemented

  • .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

Installing

PyPi

pip install zenodopy==0.2.0

GitHub

pip install -e git+https://github.com/lgloege/zenodopy.git#egg=zenodopy

Using the Package

  1. Create a Zenodo access token by first logging into your account and clicking on your username in the top right corner. Navigate to "Applications" and then "+new token" under "Personal access tokens". Keep this window open while you proceed to step 2 because the token is only displayed once.

  2. Store the token in ~/.zenodo_token using the folowing command

 { echo 'ACCESS_TOKEN: your_access_token_here' } > ~/.zenodo_token
  1. start using the zenodopy package
import zenodopy

# always start by creating a Client object
zeno = zenodopy.Client()

# list projects
zeno.list_projects

# list files 
zeno.list_files

# create a projects
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")

Notes

This project is under active development. Here is a list of things that needs improvement:

  • more tests: need to test uploading and downloading files
  • documentation: need to setup a readthedocs
  • download based on DOI: right now you can only download from your own projects. Would be nice to download from
  • asyncronous functions: use asyncio and aiohttp to write async functions. This will speed up downloading multiple files.

Metadata

Release files for zenodopy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zenodopy 0.3.0
File Size Uploaded
zenodopy-0.3.0.tar.gz 10.6 kB Details

Release files / zenodopy-0.3.0.tar.gz

Download URL zenodopy-0.3.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9cc1572b3a279c603628b433678048163fb493910764135453f6d665dce85883
BLAKE2b-256 checksum
How to use checksums
e021896032bc199ed3695f66767adf2b8484966bc39a8b2104822f0af305612e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page