asdf_pydantic.model¶
Module Contents¶
Classes¶
ASDF Serialization and Deserialization:
Serialize to ASDF yaml tree is done with the
|
API¶
- class asdf_pydantic.model.AsdfPydanticModel¶
Bases:
pydantic.BaseModelASDF Serialization and Deserialization: Serialize to ASDF yaml tree is done with the
asdf_yaml_tree()and deserialize to an AsdfPydanticModel object withmodel_validate().- _tag: ClassVar[str | asdf.extension.TagDefinition]¶
None
- model_config¶
‘ConfigDict(…)’
- asdf_yaml_tree() dict¶
Converts the model to an ASDF-compatible YAML tree (dict).
Note
Any fields that are normal Pydantic
BaseModelwill be converted to dict. See conversion table.Conversion Table:
Value type in field
Value type in dict
AsdfPydanticModel
No conversion
BaseModel
Converted to dict using BaseModel.model_dump()
Other types
No conversion
- classmethod handle_asdf_tagged_dict_compat(data: Any) dict¶
- classmethod get_tag_definition()¶
- classmethod get_tag_uri()¶
- classmethod model_asdf_schema(by_alias: bool = True, ref_template: str = DEFAULT_ASDF_SCHEMA_REF_TEMPLATE, schema_generator: type[asdf_pydantic.schema.GenerateAsdfSchema] = GenerateAsdfSchema)¶
Get the ASDF schema definition for this model.
- classmethod schema_asdf(*, metaschema: str = GenerateAsdfSchema.schema_dialect, **kwargs) str¶
Get the ASDF schema definition for this model.
Parameters
metaschema, optional A metaschema URI