asdf_pydantic.examples.extensions
=================================

.. py:module:: asdf_pydantic.examples.extensions


Classes
-------

.. autoapisummary::

   asdf_pydantic.examples.extensions.AsdfPydanticConverter
   asdf_pydantic.examples.extensions.AsdfRectangle
   asdf_pydantic.examples.extensions.AsdfNode
   asdf_pydantic.examples.extensions.ExampleExtension


Functions
---------

.. autoapisummary::

   asdf_pydantic.examples.extensions.get_extensions


Module 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:: AsdfRectangle

   Bases: :py:obj:`asdf_pydantic.AsdfPydanticModel`


   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
      :value: 'asdf://asdf-pydantic/examples/tags/rectangle-1.0.0'



   .. py:attribute:: width
      :type:  float


   .. py:attribute:: height
      :type:  float


.. py:class:: AsdfNode

   Bases: :py:obj:`Node`, :py:obj:`asdf_pydantic.AsdfPydanticModel`


   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
      :value: 'asdf://asdf-pydantic/examples/tags/node-1.0.0'



   .. py:attribute:: child
      :type:  Optional[Union[Node, AsdfNode]]
      :value: None



.. py:class:: ExampleExtension

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


   .. py:attribute:: extension_uri
      :value: 'asdf://asdf-pydantic/examples/extensions/examples-1.0.0'



   .. py:attribute:: converters


   .. py:attribute:: tags


.. py:function:: get_extensions() -> list[asdf.extension.Extension]

