Muffin-REST -- provides enhanced support for writing REST APIs with Muffin.
- API class to simplify the creation of REST APIs;
- Automatic filtering and sorting for resources;
- Support for Peewee ORM, Mongo, SQLAlchemy Core;
- Auto documentation with Swagger;
- python >= 3.9
Note
Trio is only supported with Peewee ORM
Muffin-REST should be installed using pip:
pip install muffin-rest
With SQLAlchemy Core support:
pip install muffin-rest[sqlalchemy]
With Peewee ORM support:
pip install muffin-rest[peewee]
With YAML support for autodocumentation:
pip install muffin-rest[yaml]
Create an API:
from muffin_rest import API
api = API()
Create endpoints and connect them to the API (example for sqlalchemy):
from muffin_rest.sqlalchemy import SAEndpoint
from project.api import api
@api.route
class MyEndpoint(SAEndpoint):
class Meta:
table = MyTable
database = db
Connect it to your Muffin application:
from project.api import api
api.setup(app, prefix='/api/v1')
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-rest/issues
Development of Muffin-REST happens at: https://github.com/klen/muffin-rest
- klen (Kirill Klenov)
Licensed under a MIT license.