Skip to main content

Building blocks for REST APIs for Flask

Project description

Flask-RESTy GitHub Actions 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-6.0.0.tar.gz (53.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_resty-6.0.0-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file flask_resty-6.0.0.tar.gz.

File metadata

  • Download URL: flask_resty-6.0.0.tar.gz
  • Upload date:
  • Size: 53.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flask_resty-6.0.0.tar.gz
Algorithm Hash digest
SHA256 024575d74acf3e2ef84e85ad10814072988aa457fabb20737e23ab15778f3f40
MD5 74f1fd599a48d448cb3864dc49f75f0d
BLAKE2b-256 95ec906d1cfdf70b314fc5d16607366d152967846d24a0794e6d365d76b5415d

See more details on using hashes here.

File details

Details for the file flask_resty-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: flask_resty-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flask_resty-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86bbadf14b5704e9c760ca7c9a0dfdc3a8325ffa6ddf017adece4381a8798729
MD5 5c29f10c1cfe6d26b390ac25cad6255b
BLAKE2b-256 8b7f1c3afad9d19508309468eba089573c1c0d196ede33a593c16e0b478ca61f

See more details on using hashes here.

Supported by

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