A lightweight CLI and Python library to synchronise local research data, results and analysis artifacts with Zenodo
Project description
zenodo-sync
A lightweight CLI and Python library to synchronise local research data, results and analysis artifacts with Zenodo. Designed for reproducible science and seamless data publishing workflows.
Status
🚧 Active Development - This repository is currently in active development. The core functionality is being implemented and the API may change.
The package is available on PyPI as a placeholder to reserve the name. Full functionality will be available in upcoming releases.
Features (Planned)
- 📤 Upload & Publish: Upload metadata, READMEs, and digital assets from local filesystem to Zenodo
- 📥 Download: Download published datasets to local filesystem for reproducible research
- 🔄 Sync: Bidirectional synchronization between local directories and Zenodo records
- 🔐 Authentication: Secure API token-based authentication with Zenodo
- 🧪 Sandbox Support: Test your workflows safely with Zenodo's sandbox environment
- 🎯 Semantic Versioning: Built-in support for semantic versioning of your research outputs
- 🐍 Python API: Comprehensive Python API for integration into existing workflows
- ⌨️ CLI Interface: Easy-to-use command-line interface for quick operations
Installation
From PyPI (Recommended)
pip install zenodo-sync
Development Installation
# Clone the repository
git clone https://github.com/causaliq/zenodo-sync.git
cd zenodo-sync
# Set up development environment (Windows)
scripts\setup-dev.bat
# Set up development environment (Unix/Linux/macOS)
chmod +x scripts/setup-dev.sh
./scripts/setup-dev.sh
# Or manually:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev,test]"
Quick Start
1. Get Your Zenodo API Token
- Visit Zenodo (or Zenodo Sandbox for testing)
- Go to Account Settings → Applications → Personal access tokens
- Create a new token with appropriate scopes
2. Configure Authentication
# Set environment variable
export ZENODO_TOKEN="your-api-token-here"
# Or create a .env file
cp .env.example .env
# Edit .env and add your token
3. Use the CLI
# Upload a file (to sandbox by default)
zenodo-sync upload my-dataset.csv
# Download files from a record
zenodo-sync download 12345 ./downloads/
# Sync a directory with Zenodo
zenodo-sync sync ./my-research-project/
4. Use the Python API
from zenodo_sync import ZenodoSync
# Initialize (uses sandbox by default for safety)
sync = ZenodoSync(token="your-token", sandbox=True)
# Upload a file
result = sync.upload_file("my-dataset.csv")
# Download files
files = sync.download_file("12345", "./downloads/")
# Sync directory
result = sync.sync_directory("./my-project/")
Configuration
You can configure zenodo-sync using:
-
Environment variables:
ZENODO_TOKEN: Your Zenodo API tokenZENODO_SANDBOX: Use sandbox (default: true)
-
Configuration file (
.env):ZENODO_TOKEN=your_token_here ZENODO_SANDBOX=true
-
Command-line arguments:
zenodo-sync --token your-token --production upload file.txt
Development
Requirements
- Python 3.9 or higher
- pip (latest version recommended)
Development Setup
# Clone and setup
git clone https://github.com/causaliq/zenodo-sync.git
cd zenodo-sync
# Quick setup using task runner
python tasks.py setup
# Or manual setup
pip install -e ".[dev,test]"
pre-commit install
Running Tests
# Run all tests with coverage
python tasks.py test
# Quick tests (no coverage)
python tasks.py test-quick
# Or directly with pytest
pytest -v
Code Quality
# Run all checks (lint, type-check, test)
python tasks.py check
# Format code
python tasks.py format
# Run linting only
python tasks.py lint
# Type checking
python tasks.py type-check
Building and Publishing
# Build package
python tasks.py build
# Using the build script (Windows)
scripts\build-and-publish.bat
# Manual build and upload
python -m build
twine upload --repository testpypi dist/* # Test PyPI
twine upload dist/* # Production PyPI
Contributing
We welcome contributions! Please see our contributing guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
python tasks.py check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a detailed list of changes and version history.
Support
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📚 Documentation: GitHub README
Acknowledgments
- Built for the research community
- Powered by the Zenodo platform
- Inspired by the need for reproducible science
Supported Python Versions: 3.9, 3.10, 3.11, 3.12
Default Python Version: 3.11
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zenodo_sync-0.1.0.tar.gz.
File metadata
- Download URL: zenodo_sync-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f36f667d480e3e16ab995edbbcafbd077dd6dee090158f550c6b53953b403ab
|
|
| MD5 |
e6ec71d9e796dab3bc056753eb76f428
|
|
| BLAKE2b-256 |
67f013b19bfaebd8376daa9d1aa74659c7ec83de3201385f164b89dc6b44849c
|
File details
Details for the file zenodo_sync-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zenodo_sync-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
593cc80ab280cd0aab074db7b1222032edef9adb22284d49dcda9a37bfbc162e
|
|
| MD5 |
b1403ea7b68c348561d7db426cb7094c
|
|
| BLAKE2b-256 |
a53acfc02050d22d5bb92673dd8fd0b947f30658c769a56a1504833f4e012e78
|