Metadata-Version: 2.0
Name: Flask-RESTy
Version: 0.16.0
Summary: Building blocks for REST APIs for Flask
Home-page: https://github.com/4Catalyzer/flask-resty
Author: Jimmy Jia
Author-email: tesrin@gmail.com
License: MIT
Description-Content-Type: UNKNOWN
Keywords: rest flask
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Flask
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: Flask (>=0.10)
Requires-Dist: Flask-SQLAlchemy (>=1.0)
Requires-Dist: SQLAlchemy (>=1.0.0)
Requires-Dist: Werkzeug (>=0.11)
Requires-Dist: marshmallow (>=2.2.0)
Provides-Extra: jwt
Requires-Dist: PyJWT (>=1.4.0); extra == 'jwt'
Requires-Dist: cryptography (>=2.0.0); extra == 'jwt'

.. _flask-resty-travisbuild-badgebuild-pypipypi-badgepypi:

Flask-RESTy |Travis| |PyPI|
===========================

Building blocks for REST APIs for `Flask <http://flask.pocoo.org/>`__.

|Codecov|

Usage
-----

Create a `SQLAlchemy <http://www.sqlalchemy.org/>`__ model and a
`marshmallow <http://marshmallow.rtfd.org/>`__ schema, then:

.. code:: python

    from flask_resty import Api, GenericModelView

    from .models import Widget
    from .schemas import WidgetSchema


    class WidgetViewBase(GenericModelView):
        model = Widget
        schema = WidgetSchema()


    class WidgetListView(WidgetViewBase):
        def get(self):
            return self.list()

        def post(self):
            return self.create()


    class WidgetView(WidgetViewBase):
        def get(self, id):
            return self.retrieve(id)

        def patch(self, id):
            return self.update(id, partial=True)

        def delete(self, id):
            return self.destroy(id)


    api = Api(app, '/api')
    api.add_resource('/widgets', WidgetListView, WidgetView)

.. |Travis| image:: https://img.shields.io/travis/4Catalyzer/flask-resty/master.svg
   :target: https://travis-ci.org/4Catalyzer/flask-resty
.. |PyPI| image:: https://img.shields.io/pypi/v/Flask-RESTy.svg
   :target: https://pypi.python.org/pypi/Flask-RESTy
.. |Codecov| image:: https://img.shields.io/codecov/c/github/4Catalyzer/flask-resty/master.svg
   :target: https://codecov.io/gh/4Catalyzer/flask-resty


