asdf_pydantic
=============

.. py:module:: asdf_pydantic


Subpackages
-----------

.. toctree::
   :maxdepth: 1

   /autoapi/asdf_pydantic/examples/index


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/asdf_pydantic/__version__/index
   /autoapi/asdf_pydantic/converter/index
   /autoapi/asdf_pydantic/model/index


Classes
-------

.. autoapisummary::

   asdf_pydantic.AsdfPydanticConverter
   asdf_pydantic.AsdfPydanticModel


Package Contents
----------------

.. py:class:: AsdfPydanticConverter

   Bases: :py:obj:`asdf.extension.Converter`


   Implements a converter compatible with all subclass of AsdfPydanticModel.

   The instance is a singleton.


   .. py:attribute:: _tag_to_class
      :type:  dict[str, Type[asdf_pydantic.model.AsdfPydanticModel]]


   .. py:method:: add_models(*model_classes: Type[asdf_pydantic.model.AsdfPydanticModel]) -> AsdfPydanticConverter
      :classmethod:



   .. py:property:: tags
      :type: tuple[str]



   .. py:property:: types
      :type: tuple[str | Type]



   .. py:method:: select_tag(obj, tags, ctx)


   .. py:method:: to_yaml_tree(obj: asdf_pydantic.model.AsdfPydanticModel, tag, ctx)


   .. py:method:: from_yaml_tree(node, tag, ctx)


.. py:class:: AsdfPydanticModel

   Bases: :py:obj:`pydantic.BaseModel`


   ASDF Serialization and Deserialization:
       Serialize to ASDF yaml tree is done with the
       py:classmethod`AsdfPydanticModel.asdf_yaml_tree()` and deserialize to an
       AsdfPydanticModel object with py:meth`AsdfPydanticModel.parse_obj()`.


   .. py:attribute:: _tag
      :type:  ClassVar[str]


   .. py:class:: Config

      .. py:attribute:: arbitrary_types_allowed
         :value: True




   .. py:method:: asdf_yaml_tree() -> dict


