Repository navigation
Development Provider Zenodo
Alex Valcourt Caron edited this page Oct 20, 2026
·
2 revisions
Records from Zenodo, downloaded with zenodo_get.
sequenceDiagram
actor User
participant CLI as npdb convert bagel zenodo
participant Zenodo
participant Fetch as Output staging folder
participant Prep as Shared preparation
participant Pipeline as Conversion pipeline
User->>CLI: record ID / DOI + optional token
CLI->>Zenodo: Resolve record and request files
Zenodo-->>Fetch: Record files and archives
CLI->>Prep: Extract archives and prepare BIDS root
CLI->>Pipeline: Validate, annotate, export
Pipeline-->>User: JSON-LD output
uv sync --active --extra zenodo-
Public records: nothing to do.
-
Restricted or embargoed records: a Zenodo access token, passed with
--tokenor exported:export NP_ZENODO_TOKEN=<token>
npdbpasses it tozenodo_getasaccess_token(theZENODO_ACCESS_TOKENvariable is not read byzenodo_get).
npdb convert bagel zenodo <record_id_or_doi> <output> [--cache-dir <cache>] [conversion options]
npdb convert bagel zenodo <record_id> ./out
npdb convert bagel zenodo 10.5281/zenodo.<record_id> ./out --token "$NP_ZENODO_TOKEN"- The record's file list and MD5 checksums are read first; absolute paths,
..and backslashes in file keys are rejected before anything is downloaded. - Files are downloaded into the cache at
<cache-dir>/zenodo/<record>/. Cache location precedence is--cache-dir, thenNP_NPDB_CACHE_DIR, then$XDG_CACHE_HOME/npdb/downloads(or~/.cache/npdb/downloads). Files whose MD5 already matches are not downloaded again; corrupt or partial files are replaced. - Only the record's files are copied, after an MD5 check, into
<output>/zenodo_<record>, keeping nested keys (GitHub releases use<repo>/<release>.zip). Archives are then extracted and the wrapped BIDS root, for examplespine-generic/spine-generic-data-multi-subject-<commit>/, is selected before conversion. - Leave room for the cached archive in the cache, and for the staged archive plus its extracted content on the output disk. The cache and the staging folder must not overlap.
Using data
Tutorials
Infrastructure