Skip to main content

Building blocks for REST APIs for Flask

Project description

Flask-RESTy Travis Codecov PyPI marshmallow 2/3 compatible

Flask-RESTy provides building blocks for creating REST APIs with Flask, SQLAlchemy, and marshmallow.

from flask_resty import Api, GenericModelView

from . import app, models, schemas


class WidgetViewBase(GenericModelView):
    model = models.Widget
    schema = schemas.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)

Documentation

Documentation is available at https://flask-resty.readthedocs.io/.

License

MIT Licensed. See the bundled LICENSE file for more details.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-RESTy-0.21.2.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

Flask_RESTy-0.21.2-py2.py3-none-any.whl (37.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Flask-RESTy-0.21.2.tar.gz.

File metadata

  • Download URL: Flask-RESTy-0.21.2.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for Flask-RESTy-0.21.2.tar.gz
Algorithm Hash digest
SHA256 5d110ecb796cf81cc703d8a157309fd8dbdbd86c9ebf19a94846700b7e326528
MD5 8799dadda6fe400e5e663b27aa083a00
BLAKE2b-256 2d0146f88cf0a416c658b0b78e0744b603e7d7509d0215bfc77f4c71eb1c71f4

See more details on using hashes here.

File details

Details for the file Flask_RESTy-0.21.2-py2.py3-none-any.whl.

File metadata

  • Download URL: Flask_RESTy-0.21.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 37.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for Flask_RESTy-0.21.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9e8b5800baf74f8cd1e5cbc4cbafb1daeb84d82130500ced97dd6c3c574e6ebd
MD5 087dab74084f5aabec029a4801788609
BLAKE2b-256 f49eab55141518b676fda0a5ad534825336deff4124c0c153c694b87bb536e71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page