Metadata-Version: 2.0
Name: marshmallow-annotations
Version: 1.0.0
Summary: Allows declaring marshmallow fields as annotations
Home-page: https://github.com/justanr/marshmallow-annotations
Author: Alec Nikolas Reiter
Author-email: alecreiter@gmail.com
License: MIT
Keywords: annotations,marshmallow
Platform: UNKNOWN
Classifier: Topic :: Utilities
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Dist: marshmallow

====================
marshmallow-annotations
====================

.. code-block:: python

        from marshmallow_annotations import AnnotatedSchema
        from marshmallow import fields

        class BookSchema(AnnotatedSchema):
            author: fields.String()
            title: fields.String()
            published: fields.Date()

        book = dict(author='Anne Droid', title='Robots', published='3000-01-23')
        BookSchema().dump(book).data
        # {
        #     'author': 'Anne Droid',
        #     'title': 'Robots',
        #     'published': date(3000, 1, 23)
        # }

Install
=======

.. code-block:: bash

        pip install marshmallow-annotations

Why?
====

Why not? Type annotations are pretty cool and so is marshmallow, it's like the chocolate peanut butter cup of data validation.


