Skip to main content

Schemata for DANDI archive project

Project description

DANDI Schema

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

Project details


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.12.1.tar.gz (98.7 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.12.1-py3-none-any.whl (118.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dandischema-0.12.1.tar.gz
  • Upload date:
  • Size: 98.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dandischema-0.12.1.tar.gz
Algorithm Hash digest
SHA256 481ed1da9481090d8000b3b2373a0d4876043f48d4cddc3364c18e0a97bd0c22
MD5 0397e9a1cb4633c509ed573ffac642ee
BLAKE2b-256 23b7b44244184c16c1b1cc69070b53325965285b81843ad7755c429e1ffaa341

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dandischema-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 118.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dandischema-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88f84cefd7883ce15d5c2f6b92411b1d00fd76468b77950fff25381e17eaab44
MD5 ac1a43235121e8ffb43ba53571de79d9
BLAKE2b-256 cb16959ccdc06e45781d3c41cd552baeaaf563ffb5fe240fbd24efd26b8b2b12

See more details on using hashes here.

Supported by

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