Skip to main content

Zenodo Command-Line Uploader

PyPI version License: MIT PyPI - Python Version CI/CD Status

A flexible and powerful tool to upload files to Zenodo, available as both a command-line utility and an importable Python library.

This tool supports creating new depositions, updating existing drafts, listing records, and interactive configuration. It is designed for both manual use and integration into automated workflows.

Features ✨

  • Create new depositions with multiple files.
  • List all your existing records (both drafts and published).
  • Update existing drafts by adding files or modifying metadata.
  • Interactive setup command (configure) to easily create your configuration file.
  • Configuration file support (.zenodo.toml) for persistent settings (tokens, author info).
  • Progress bars during file uploads for an improved user experience.
  • Professional logging system with a --verbose option for debugging.
  • Usable as both a standalone CLI tool and a Python library.

Installation

You can install the tool directly from PyPI:

pip install zenodo-uploader

For the best experience, run the interactive setup command first. It will securely store your tokens and default information.

zenodo-upload configure

This will create a .zenodo.toml file in your home directory. The tool will automatically use the settings from this file.

Here is an example of the .zenodo.toml file structure:

[default]
author = "Your Name"
affiliation = "Your University"

[tokens]
production = "YOUR_PRODUCTION_TOKEN_HERE"
sandbox = "YOUR_SANDBOX_TOKEN_HERE"

Getting a Zenodo Access Token

This tool requires a Personal Access Token to interact with your Zenodo account.

1. For the Main Zenodo Site (Production)

  1. Log in to https://zenodo.org.
  2. Navigate to your Applications settings: https://zenodo.org/account/settings/applications/.
  3. Click "New token".
  4. Give the token a name and select the deposit:write and deposit:actions scopes.
  5. Click "Create" and copy the token immediately.

2. For the Zenodo Sandbox (for Testing)

The process is identical on the Sandbox website: https://sandbox.zenodo.org/account/settings/applications/. Sandbox and production tokens are not interchangeable.

Command-Line Usage

The tool now uses subcommands: configure, list, upload, and update.

configure: Interactive Setup

Creates the .zenodo.toml configuration file for you.

# Run the interactive setup wizard
zenodo-upload configure

list: Listing Your Records

Lists all depositions (drafts and published) in your account.

# List records from the sandbox environment
zenodo-upload list --sandbox

upload: Creating a New Record

Creates a new deposition and uploads files. By default, it creates a draft.

# Create a new draft on the sandbox using values from your config file
zenodo-upload upload \
--file-paths ./report.pdf ./dataset.zip \
--title "My Research Project Results" \
--description "This record contains the final report and raw data." \
--sandbox

update: Modifying a Draft

Updates an existing draft deposition.

# Add a new file to an existing draft in the sandbox
zenodo-upload update 1234567 --add-file ./new_figure.png --sandbox

For a full list of options for any subcommand, use --help, for example: zenodo-upload upload --help.

As a Python Library

You can import and use the core functions directly in your Python scripts. The package exposes upload, list_depositions, and update_deposition.

Example 1: Creating a New Upload

from zenodo_uploader import upload

MY_TOKEN = "PASTE_YOUR_SANDBOX_TOKEN_HERE"

metadata = {
    "title": "My Automated Dataset",
    "author": "Script, Python",
    "description": "This upload was performed programmatically.",
}

# This creates a new draft in the sandbox
response_data = upload(
    token=MY_TOKEN,
    file_paths=["./data/report.txt"],
    metadata=metadata,
    sandbox=True,
    publish=False
)
print(f"Draft created: {response_data.get('links', {}).get('latest_draft_html')}")

Example 2: Listing and Updating a Draft

from zenodo_uploader import list_depositions, update_deposition

TOKEN = "YOUR_SANDBOX_TOKEN_HERE"

# First, list depositions to find a draft
print("--- Listing depositions ---")
all_deps = list_depositions(token=TOKEN, sandbox=True)
drafts = [d for d in all_deps if not d['submitted']]

if not drafts:
    print("No drafts found to update.")
else:
    draft_id = drafts[0]['id']
    print(f"\n--- Found draft with ID {draft_id}. Updating it... ---")
    
    # Create a new file to add
    with open("update_log.txt", "w") as f:
        f.write("This file was added during an update.")
        
    # Call the update function to add the file and change the description
    updated_dep = update_deposition(
        token=TOKEN,
        deposition_id=draft_id,
        files_to_add=["update_log.txt"],
        metadata={"description": "Description updated programmatically."},
        sandbox=True
    )
    print("\n--- Update Successful ---")
    print(f"Review the updated draft at: {updated_dep.get('links', {}).get('latest_draft_html')}")

License

This project is licensed under the MIT License.

Metadata

Release files for zenodo-uploader 0.1.3

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

Source distribution (sdist)

Source distribution for zenodo-uploader 0.1.3
File Size Uploaded Provenance Actions
zenodo_uploader-0.1.3.tar.gz 10.7 kB With provenance Details for zenodo_uploader-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zenodo-uploader 0.1.3
File Interpreter ABI Platform Actions
zenodo_uploader-0.1.3-py3-none-any.whl Python 3 none any Details for zenodo_uploader-0.1.3-py3-none-any.whl

Total release size: 20.0 kB

Release files / zenodo_uploader-0.1.3.tar.gz

Download URL zenodo_uploader-0.1.3.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f4e0a58599855be4dd26e43bb013e230ab106a8c8e6d5af43705d91d2513e635
BLAKE2b-256 checksum
How to use checksums
48da3d5aac037da6aa379265c6d06029394bcce6586d424797b80a98bccc5920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2025.

Transparency log

Release files / zenodo_uploader-0.1.3-py3-none-any.whl

Download URL zenodo_uploader-0.1.3-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e39a03c4d818c2cfa28a124c5b01c1bbce4be9317af1eec08a7687079c60b322
BLAKE2b-256 checksum
How to use checksums
b603c863b3a43d3454329297a8fe7a98217267ad7c36fa7d26c4d6e50820e8f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2025.

Transparency log

Security for zenodo-uploader 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zenodo_uploader-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files Full provenance

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