aind_data_schema package#

Subpackages#

Submodules#

aind_data_schema.base module#

generic base class with supporting validators and fields for basic AIND schema

pydantic model aind_data_schema.base.AindCoreModel#

Bases: AindModel

Generic base class to hold common fields/validators/etc for all basic AIND schema

Show JSON schema
{
   "title": "AindCoreModel",
   "description": "Generic base class to hold common fields/validators/etc for all basic AIND schema",
   "type": "object",
   "properties": {
      "describedBy": {
         "title": "Describedby",
         "type": "string"
      },
      "schema_version": {
         "description": "schema version",
         "pattern": "^\\d+.\\d+.\\d+$",
         "title": "Version",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "describedBy",
      "schema_version"
   ]
}

Config:
  • extra: str = forbid

  • use_enum_values: bool = True

Fields:
field describedBy: str [Required]#
field schema_version: str [Required]#

schema version

Constraints:
  • pattern = ^d+.d+.d+$

classmethod default_filename()#

Returns standard filename in snakecase

model_post_init(__context: Any) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • __context – The context.

write_standard_file(output_directory: Path | None = None, prefix: str | None = None, suffix: str | None = None)#

Writes schema to standard json file :param output_directory: optional Path object for output directory.

Default: None

Parameters:
  • prefix (Optional[str]) – optional str for intended filepath with extra naming convention Default: None

  • suffix (Optional[str]) – optional str for intended filepath with extra naming convention Default: None

pydantic model aind_data_schema.base.AindGeneric#

Bases: BaseModel

Base class for generic types that can be used in AIND schema

Show JSON schema
{
   "title": "AindGeneric",
   "description": "Base class for generic types that can be used in AIND schema",
   "type": "object",
   "properties": {},
   "additionalProperties": true
}

Config:
  • extra: str = allow

pydantic model aind_data_schema.base.AindModel#

Bases: BaseModel, Generic[AindGenericType]

BaseModel that disallows extra fields

Show JSON schema
{
   "title": "AindModel",
   "description": "BaseModel that disallows extra fields",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

Config:
  • extra: str = forbid

  • use_enum_values: bool = True

Module contents#

imports for AindModel subclasses