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-0.23.1.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

Flask_RESTy-0.23.1-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Flask-RESTy-0.23.1.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for Flask-RESTy-0.23.1.tar.gz
Algorithm Hash digest
SHA256 ede6ab75f71a269fedd016447b66811d1a6d387ba6e0f34a5723367db0c4415f
MD5 5855d44624648878f5f14036e3b13844
BLAKE2b-256 9c073019cd7eb260959e92053c2f24dd65499cf9059cca33814aad2ef8873b6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Flask_RESTy-0.23.1-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for Flask_RESTy-0.23.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1c231f174232514e6ee85d3df550b91bcad4c83d59c554cdcc502efebfee8f
MD5 1c72b8bd41eb9bb392e76d7d602c14ec
BLAKE2b-256 643619dba3dd5afb5b945e447dd89afde6e78a7f7a4a700b9b94daa0e9f5bab6

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