Building blocks for REST APIs for Flask
Project description
Flask-RESTy
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d110ecb796cf81cc703d8a157309fd8dbdbd86c9ebf19a94846700b7e326528 |
|
MD5 | 8799dadda6fe400e5e663b27aa083a00 |
|
BLAKE2b-256 | 2d0146f88cf0a416c658b0b78e0744b603e7d7509d0215bfc77f4c71eb1c71f4 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e8b5800baf74f8cd1e5cbc4cbafb1daeb84d82130500ced97dd6c3c574e6ebd |
|
MD5 | 087dab74084f5aabec029a4801788609 |
|
BLAKE2b-256 | f49eab55141518b676fda0a5ad534825336deff4124c0c153c694b87bb536e71 |