aind_data_schema package#

Subpackages#

Submodules#

aind_data_schema.base module#

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

class aind_data_schema.base.AindCoreModel(*, describedBy: str, schema_version: str[str])#

Bases: AindModel

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

classmethod default_filename()#

Returns standard filename in snakecase

describedBy: str#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'describedBy': FieldInfo(annotation=str, required=True), 'schema_version': FieldInfo(annotation=str, required=True, title='Version', description='schema version', frozen=True, metadata=[_PydanticGeneralMetadata(pattern='^\\d+.\\d+.\\d+$')])}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

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.

schema_version: str#
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

class aind_data_schema.base.AindGeneric(**extra_data: Any)#

Bases: BaseModel

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

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'allow'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class aind_data_schema.base.AindModel#

Bases: BaseModel, Generic[AindGenericType]

BaseModel that disallows extra fields

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'use_enum_values': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

Module contents#

imports for AindModel subclasses