Skip to main content

Building blocks for REST APIs for Flask

Project description

Flask-RESTy Travis Codecov PyPI marshmallow 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-1.9.0.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

Flask_RESTy-1.9.0-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Flask-RESTy-1.9.0.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for Flask-RESTy-1.9.0.tar.gz
Algorithm Hash digest
SHA256 3cd2cbfd166138cc03111762e85933b14cbbb742eeb2b666aa26b4453e752706
MD5 0f0abfddd44c091f857743325e04ef94
BLAKE2b-256 145a78c60f0fc94641a1af99932dc91da871d06a28f78014b346ef1998d9102d

See more details on using hashes here.

File details

Details for the file Flask_RESTy-1.9.0-py3-none-any.whl.

File metadata

  • Download URL: Flask_RESTy-1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for Flask_RESTy-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71aa4764974debc8c7ad1228ec11bf0878368d620c6b811de9b706aa67ad51ac
MD5 621bebff0482e949b1f8c7e4c30dd6bc
BLAKE2b-256 4b1c78ec5e6b7551d9f1abe3ac58fe8bfd4777e66436b7e072b48cf04a6a84e4

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