dandi service-scripts

dandi [<global options>] service-scripts [<command>]

dandi service-scripts is a collection of subcommands for various utility operations.

reextract-metadata

dandi [<global options>] service-scripts reextract-metadata [<options>] <url>

Recompute & update the metadata for NWB assets on a remote server.

<url> must point to a draft Dandiset or one or more assets inside a draft Dandiset. See Resource Identifiers for allowed URL formats.

Running this command requires the fsspec library to be installed with the http extra (e.g., pip install "fsspec[http]").

Options

--diff

Show diffs of old & new metadata for each re-extracted asset

--when [newer-schema-version|always]

Specify when to re-extract an asset’s metadata:

  • newer-schema-version (default) — when the schemaVersion in the asset’s current metadata is missing or older than the schema version currently in use by DANDI

  • always — always

update-dandiset-from-doi

dandi [<global options>] service-scripts update-dandiset-from-doi --dandiset=<DANDISET ID> [<options>] <doi>

Update the metadata for the draft version of a Dandiset with information from a given DOI record.

Options

-d, --dandiset <DANDISET ID>

Specify the ID of the Dandiset to operate on. This option is required.

-i, --dandi-instance <instance>

DANDI instance (either a base URL or a known instance name) where the Dandiset is located [default: dandi]

-e, --existing [ask|overwrite|skip]

Specify the behavior when a value would be set on or added to the Dandiset metadata:

  • ask [default] — Ask the user with confirmation before making the change

  • overwrite — Make the change without asking for confirmation

  • skip — Do not change anything, but still print out details on what would have been changed

-F, --fields [contributor,name,description,relatedResource,all]

Comma-separated list of Dandiset metadata fields to update [default: all]

-y, --yes

Show the final metadata diff and save any changes without asking for confirmation