Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

download_zenodo.py — Zenodo download orchestrator

Description

Single entry point for all Zenodo downloads. Parses any Zenodo URL, DOI, or record ID, determines whether the target is a public record or a private draft/community request, and delegates to the appropriate script.

When no --zenodo-id is given, the orchestrator queries the Jira ticket for the “Replication package URL”.

Usage

# Explicit ID or URL
python3.12 tools/download_zenodo.py --zenodo-id 10848594
python3.12 tools/download_zenodo.py --zenodo-id https://zenodo.org/records/10848594
python3.12 tools/download_zenodo.py --zenodo-id https://zenodo.org/communities/aeajournals/requests/61cff0cb-b3ca-48aa-bfe6-5b17dc8eb665

# From Jira ticket
python3.12 tools/download_zenodo.py --jira-ticket AEAREP-8983

# In a pipeline (capture directory name)
zenodo_dir=$(python3.12 tools/download_zenodo.py --zenodo-id "$ZenodoID" --print-id 2>&1 | tail -1)

Options

OptionDescription
--zenodo-id URL_OR_IDZenodo record ID, URL, DOI, or community request URL. Skips Jira lookup.
--jira-ticket KEYJira issue key; used when --zenodo-id is absent
--print-idPrint zenodo-NNNNN to stdout (last line) for pipeline capture
--dry-runPass through to the selected download script
--sandboxUse sandbox.zenodo.org

URL Routing

URL patternScript called
/records/NNNNN, /record/NNNNN, 10.5281/zenodo.NNNNN, bare IDdownload_zenodo_public.py
/deposit/NNNNNdownload_zenodo_draft.py
/communities/.../requests/{uuid}download_zenodo_draft.py (resolves UUID → record ID via API)

Environment Variables

VariablePurpose
JIRA_USERNAME, JIRA_API_KEYRequired when --jira-ticket is used
ZENODO_ACCESS_TOKENRequired for draft/private downloads
CIAuto-commit behaviour in pipelines

Exit Codes

CodeMeaning
0Success
1Error
2Replication URL from Jira is not a Zenodo URL

See Also