.. meta::
   :description: diwire supported frameworks examples: dataclasses, NamedTuple, attrs, pydantic, and msgspec dependency extraction.

Supported frameworks
====================

What you'll learn
-----------------

- Which constructor/field patterns diwire can extract dependencies from.

Dataclass
---------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_12_supported_frameworks/01_dataclass.py

.. literalinclude:: ../../../examples/ex_12_supported_frameworks/01_dataclass.py
   :language: python
   :class: diwire-example

NamedTuple
----------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_12_supported_frameworks/02_namedtuple.py

.. literalinclude:: ../../../examples/ex_12_supported_frameworks/02_namedtuple.py
   :language: python
   :class: diwire-example

attrs
-----

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_12_supported_frameworks/03_attrs.py

.. literalinclude:: ../../../examples/ex_12_supported_frameworks/03_attrs.py
   :language: python
   :class: diwire-example

Pydantic
--------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_12_supported_frameworks/04_pydantic.py

.. literalinclude:: ../../../examples/ex_12_supported_frameworks/04_pydantic.py
   :language: python
   :class: diwire-example

msgspec
-------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_12_supported_frameworks/05_msgspec.py

.. literalinclude:: ../../../examples/ex_12_supported_frameworks/05_msgspec.py
   :language: python
   :class: diwire-example
