# Flask-RESTy [![Travis][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, 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](https://github.com/4Catalyzer/flask-resty/blob/master/LICENSE) file for more details.
[build-badge]: https://img.shields.io/travis/4Catalyzer/flask-resty/master.svg
[build]: https://travis-ci.org/4Catalyzer/flask-resty
[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
Raw data
{
"_id": null,
"home_page": "https://github.com/4Catalyzer/flask-resty",
"name": "Flask-RESTy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "rest flask",
"author": "4Catalyzer",
"author_email": "tesrin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f3/ae/938198dc764e8dc1e39b6823779a98faecbe62a782e2bf90a37f621c0af4/Flask-RESTy-5.0.0.tar.gz",
"platform": null,
"description": "# Flask-RESTy [![Travis][build-badge]][build] [![Codecov][codecov-badge]][codecov] [![PyPI][pypi-badge]][pypi] [![marshmallow 3 compatible][marshmallow-badge]][marshmallow-upgrading]\n\nFlask-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/).\n\n```python\nfrom flask_resty import Api, GenericModelView\n\nfrom . import app, models, schemas\n\n\nclass WidgetViewBase(GenericModelView):\n model = models.Widget\n schema = schemas.WidgetSchema()\n\n\nclass WidgetListView(WidgetViewBase):\n def get(self):\n return self.list()\n\n def post(self):\n return self.create()\n\n\nclass WidgetView(WidgetViewBase):\n def get(self, id):\n return self.retrieve(id)\n\n def patch(self, id):\n return self.update(id, partial=True)\n\n def delete(self, id):\n return self.destroy(id)\n\n\napi = Api(app, \"/api\")\napi.add_resource(\"/widgets\", WidgetListView, WidgetView)\n```\n\n## Documentation\n\nDocumentation is available at https://flask-resty.readthedocs.io/.\n\n## License\n\nMIT Licensed. See the bundled [LICENSE](https://github.com/4Catalyzer/flask-resty/blob/master/LICENSE) file for more details.\n\n[build-badge]: https://img.shields.io/travis/4Catalyzer/flask-resty/master.svg\n[build]: https://travis-ci.org/4Catalyzer/flask-resty\n[pypi-badge]: https://img.shields.io/pypi/v/Flask-RESTy.svg\n[pypi]: https://pypi.python.org/pypi/Flask-RESTy\n[codecov-badge]: https://img.shields.io/codecov/c/github/4Catalyzer/flask-resty/master.svg\n[codecov]: https://codecov.io/gh/4Catalyzer/flask-resty\n[marshmallow-badge]: https://badgen.net/badge/marshmallow/3\n[marshmallow-upgrading]: https://marshmallow.readthedocs.io/en/latest/upgrading.html\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Building blocks for REST APIs for Flask",
"version": "5.0.0",
"project_urls": {
"Homepage": "https://github.com/4Catalyzer/flask-resty"
},
"split_keywords": [
"rest",
"flask"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0c7e1f8d02efbfb55af178f497da29c941180f491baf209a0161b3d5afb8bcd8",
"md5": "401cc451ce23accf7e8988c5bc97a3b8",
"sha256": "4362e1bc863ca64ad30a066644b07b4963e5be2c8b0ba716df074b9e638a0791"
},
"downloads": -1,
"filename": "Flask_RESTy-5.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "401cc451ce23accf7e8988c5bc97a3b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 42033,
"upload_time": "2024-02-20T03:27:19",
"upload_time_iso_8601": "2024-02-20T03:27:19.320923Z",
"url": "https://files.pythonhosted.org/packages/0c/7e/1f8d02efbfb55af178f497da29c941180f491baf209a0161b3d5afb8bcd8/Flask_RESTy-5.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f3ae938198dc764e8dc1e39b6823779a98faecbe62a782e2bf90a37f621c0af4",
"md5": "5e7495ff3563e48d443d73c8aac47983",
"sha256": "13e6ff4f3527de34f9cabc295d507e9ace0714348c21366cf9991e79196e966d"
},
"downloads": -1,
"filename": "Flask-RESTy-5.0.0.tar.gz",
"has_sig": false,
"md5_digest": "5e7495ff3563e48d443d73c8aac47983",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 53343,
"upload_time": "2024-02-20T03:27:21",
"upload_time_iso_8601": "2024-02-20T03:27:21.898447Z",
"url": "https://files.pythonhosted.org/packages/f3/ae/938198dc764e8dc1e39b6823779a98faecbe62a782e2bf90a37f621c0af4/Flask-RESTy-5.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-20 03:27:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "4Catalyzer",
"github_project": "flask-resty",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "flask-resty"
}