Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/4catalyzer/flask-resty
Building blocks for REST APIs for Flask
https://github.com/4catalyzer/flask-resty
flask
Last synced: 5 days ago
JSON representation
Building blocks for REST APIs for Flask
- Host: GitHub
- URL: https://github.com/4catalyzer/flask-resty
- Owner: 4Catalyzer
- License: mit
- Created: 2015-07-24T23:29:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-15T08:26:29.000Z (about 1 month ago)
- Last Synced: 2024-12-17T23:04:40.731Z (5 days ago)
- Topics: flask
- Language: Python
- Homepage: https://flask-resty.readthedocs.io/en/latest/
- Size: 843 KB
- Stars: 86
- Watchers: 14
- Forks: 13
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask-RESTy [![GitHub Actions][build-badge]][build] [![Codecov][codecov-badge]][codecov] [![PyPI][pypi-badge]][pypi] [![marshmallow 3 compatible][marshmallow-badge]][marshmallow-upgrading]
Flask-RESTy provides building blocks for creating REST APIs with [Flask](http://flask.pocoo.org/), [SQLAlchemy](https://www.sqlalchemy.org/), and [marshmallow](https://marshmallow.readthedocs.io/).
```python
from flask_resty import Api, GenericModelViewfrom . 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](https://github.com/4Catalyzer/flask-resty/blob/master/LICENSE) file for more details.
[build-badge]: https://github.com/4Catalyzer/flask-resty/actions/workflows/main.yml/badge.svg
[build]: https://github.com/4Catalyzer/flask-resty/actions
[pypi-badge]: https://img.shields.io/pypi/v/Flask-RESTy.svg
[pypi]: https://pypi.python.org/pypi/Flask-RESTy
[codecov-badge]: https://img.shields.io/codecov/c/github/4Catalyzer/flask-resty/master.svg
[codecov]: https://codecov.io/gh/4Catalyzer/flask-resty
[marshmallow-badge]: https://badgen.net/badge/marshmallow/3
[marshmallow-upgrading]: https://marshmallow.readthedocs.io/en/latest/upgrading.html