Metadata-Version: 2.0
Name: annotype
Version: 0.1.1
Summary: Marshmallow and Python 3 annotations
Home-page: https://github.com/cbourget/annotype
Author: Charles-Eric Bourget
Author-email: charlesericbourget@gmail.com
License: MIT
Download-URL: https://github.com/cbourget/annotype/archive/0.1.1.tar.gz
Keywords: annotation marshmallow type
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Dist: marshmallow (>=3.0.0b7)
Provides-Extra: tests
Requires-Dist: pytest; extra == 'tests'
Requires-Dist: coverage; extra == 'tests'
Requires-Dist: pytest-cov; extra == 'tests'

Annotype: Python 3 annotations and marshmallow
==============================================

**Annotype** combines Python 3 annotations and Marshmallow for powerful
validation of function arguments.

.. code:: python

    from annotype import annotyped
    from marshmallow import (
        Schema,
        fields
    )


    class PersonSchema(Schema):
        firstname = fields.Str(required=True)
        lastname = fields.Str(required=True)

    @annotyped()
    def salute(person: SampleSchema):
        print 'Hello {} {}'.format(person['firstname'], person['lastnamename'])

    person = dict(firstname='John')

    # This will raise a ValidationError because lastname is not defined
    salute(person)

    @annotyped()
    def welcome(firstname: fields.Str(), lastname: fields.Str()):
        print 'Welcome {} {}'.format(firstname, lastname)

    # This will also raise a ValidationError because lastname is not a string
    welcome('Jane', 1)

In short, annotype allows you to validate data using the powerful
marshmallow library and the Python 3 annotations.

Get It Now
----------

::

    $ pip install -U annotype

Documentation
-------------

See marshmallow documentation available here
http://marshmallow.readthedocs.io/ .

Requirements
------------

-  Python >= 3.4
-  marshmallow >= 3.0.0

License
-------

MIT licensed. See the bundled
`LICENSE <https://github.com/cbourget/annotype/blob/pypi/LICENSE>`__
file for more details.


