DANDI Client
Data management including upload, download, and validation is handled through a local DANDI Client.
The DANDI Client provides both a command line interface (CLI) and Python API.
Update the DANDI Client to reference your API¶
To reference your DANDI-clone API, update the URLs reference per each CLI action and push a PR to the dandi-cli GitHub repository.
Here is an example PR of another clone adding to the available instances of DandiInstance
objects in the dandi-cli
.
For example:
known_instances = {
"dandi": DandiInstance(
"dandi",
"https://dandiarchive.org",
"https://api.dandiarchive.org/api",
),
"dandi-staging": DandiInstance(
"dandi-staging",
"https://gui-staging.<your-domain>.org",
"https://api-staging.<your-domain>.org/api",
),
"dandi-api-local-docker-tests": DandiInstance(
"dandi-api-local-docker-tests",
f"http://{instancehost}:8085",
f"http://{instancehost}:8000/api",
),
"<your-dandi-clone>": DandiInstance( # Your own "dandi"
"<your-dandi-clone>", # Your own "dandi"
"https://<your-dandi-clone-domain>.org",
"https://api.<your-dandi-clone-domain>.org/api",
),
}
Once your DANDI clone is added to the list of available DandiInstance
objects, you should be able to perform operations via the -i
flag. For example:
dandi upload -i <your-dandi-clone>
Access credentials¶
Users will be prompted for a DANDI_API_KEY
environment variable. This variable does not need to be unique to your DANDI clone. A user can just set their DANDI_API_KEY
to the value that your DANDI API clone issues. See docs on storing access credentials.
Versioning¶
The DANDI Client leverages a tool called versioneer for semantic versioning in PyPI.
Upon merging of a PR into master
, if the release
label is attached to the PR
versioneer
will generate a human-readable CHANGELOG entry, and then push to PyPI the new semantic version. For more details on labeling dandi-cli
pull requests, see here.