Skip to main content

DANDI Schema

Tests Integration Tests

dandi-schema is a Python library for maintaining and managing DANDI metadata models and schemas.

Installation

pip install dandischema

Description

DANDI — the Distributed Archives for Neurophysiology Data Integration — is a BRAIN Initiative-supported platform for publishing, sharing, and processing cellular neurophysiology data. Every Dandiset or associated asset is described by a structured metadata object that can be retrieved through the DANDI API. The dandi-schema library provides Python data models and helper utilities to create, validate, migrate, and manage these metadata objects. It uses Pydantic models to define metadata models, and the JSON Schema schemas corresponding to the Pydantic models are generated, versioned, and stored in the dandi/schema repository with an associated context.json file for JSON-LD compliance. Both representations of the metadata models — the Pydantic models and their corresponding JSON Schema schemas — are used across the DANDI ecosystem (see the dedicated section in DANDI Docs for integration details). Additionally, this library provides tools for converting Dandiset metadata to DataCite metadata for DOI generation.

Important files in this repository include:

  • models.py - contains the Pydantic models defining the metadata models
  • metadata.py - contains functions for validating, migrating, and aggregating metadata
  • datacite package - contains functions for converting Dandiset metadata to DataCite metadata

Customization with Vendor Information

The DANDI metadata models defined in this library can be customized with vendor-specific information. The parameters of the customization are defined by the fields of the Config class in dandischema/conf.py. The Config class is a subclass of pydantic_settings.BaseSettings, and the values of the fields in an instance of the Config class can be set through environment variables and .env files, as documented in the Pydantic Settings documentation. Specifically,

  • The value of a field is set from an environment variable with the same name, case-insensitively, as one of the aliases of the field. For example, the instance_name field can be set from the DANDI_INSTANCE_NAME or DJANGO_DANDI_INSTANCE_NAME environment variable.
  • A value of a complex type (e.g., list, set, dict) should be expressed as a JSON-encoded string in an environment variable. For example, the value for the licenses field, which is of type set, can be set from the DANDI_LICENSES environment variable defined as the following:
    export DANDI_LICENSES='["spdx:CC0-1.0", "spdx:CC-BY-4.0"]'
    

Resources

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dandischema-0.14.0.tar.gz (102.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dandischema-0.14.0-py3-none-any.whl (122.0 kB view details)

Uploaded Python 3

File details

Details for the file dandischema-0.14.0.tar.gz.

File metadata

  • Download URL: dandischema-0.14.0.tar.gz
  • Upload date:
  • Size: 102.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for dandischema-0.14.0.tar.gz
Algorithm Hash digest
SHA256 963af71311c356bce99c4e056754f3a2bd1a4f33836f13d9197c399c7732176f
MD5 76d407e88adcf98e626f1c3c9dd6e6d3
BLAKE2b-256 d9e655c462074cb9106b553c53bc83b66b98a487ee32e154acbbe34b98c1fd9a

See more details on using hashes here.

File details

Details for the file dandischema-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: dandischema-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 122.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for dandischema-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fce0c6c9df5b9504a230ba44d623656f4a798507f47fc3c9b0777cda016fbb73
MD5 0421d04baf2bc5bd825b6397184d60ed
BLAKE2b-256 a8b50f0828a19e023ccf5535b69d434611a7cfd17fed88bc1eca7c836339c908

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.14.0 This release

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page