Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/biosustain/potion
Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine
https://github.com/biosustain/potion
flask flask-extensions mongoengine peewee sqlalchemy
Last synced: 13 days ago
JSON representation
Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine
- Host: GitHub
- URL: https://github.com/biosustain/potion
- Owner: biosustain
- License: other
- Created: 2014-09-15T08:52:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-04-23T17:00:39.000Z (over 5 years ago)
- Last Synced: 2024-07-31T23:39:01.161Z (3 months ago)
- Topics: flask, flask-extensions, mongoengine, peewee, sqlalchemy
- Language: Python
- Homepage: http://potion.readthedocs.io
- Size: 646 KB
- Stars: 488
- Watchers: 18
- Forks: 51
- Open Issues: 51
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-flask - Flask-Potion - RESTful API framework for Flask and SQLAlchemy (Framework)
- awesome-flask - Flask-Potion - RESTful API framework for Flask and SQLAlchemy (Framework)
- top-pharma50 - **biosustain/potion** - Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine<br>`flask`, `flask-extensions`, `mongoengine`, `peewee`, `sqlalchemy`<br><img src='https://github.com/HubTou/topgh/blob/main/icons/gstars.png'> 488 <img src='https://github.com/HubTou/topgh/blob/main/icons/forks.png'> 51 <img src='https://github.com/HubTou/topgh/blob/main/icons/code.png'> Python <img src='https://github.com/HubTou/topgh/blob/main/icons/license.png'> Other <img src='https://github.com/HubTou/topgh/blob/main/icons/last.png'> 2019-04-23 17:00:39 | (Ranked by starred repositories)
- awesome-rest - Flask-Potion - Flask-Potion is a powerful Flask extension for building RESTful JSON APIs. It also provides several Clients for easier access to the API. (Servers / Python)
- top-life-sciences - **biosustain/potion** - Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine<br>`flask`, `flask-extensions`, `mongoengine`, `peewee`, `sqlalchemy`<br><img src='https://github.com/HubTou/topgh/blob/main/icons/gstars.png'> 488 <img src='https://github.com/HubTou/topgh/blob/main/icons/forks.png'> 51 <img src='https://github.com/HubTou/topgh/blob/main/icons/code.png'> Python <img src='https://github.com/HubTou/topgh/blob/main/icons/license.png'> Other <img src='https://github.com/HubTou/topgh/blob/main/icons/last.png'> 2019-04-23 17:00:39 | (Ranked by starred repositories)
- awesome-flask - Flask-Potion - RESTful API framework for Flask and SQLAlchemy (Framework)
- jimsghstars - biosustain/potion - Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine (Python)
README
============
Flask-Potion
============.. image:: https://img.shields.io/travis/biosustain/potion/master.svg?style=flat-square
:target: https://travis-ci.org/biosustain/potion.. image:: https://img.shields.io/coveralls/biosustain/potion/master.svg?style=flat-square
:target: https://coveralls.io/r/biosustain/potion.. image:: https://img.shields.io/pypi/v/Flask-Potion.svg?style=flat-square
:target: https://pypi.python.org/pypi/Flask-Potion.. image:: https://img.shields.io/pypi/l/Flask-Potion.svg?style=flat-square
:target: https://pypi.python.org/pypi/Flask-Potion.. image:: https://badges.gitter.im/Join%20Chat.svg
:alt: Join the chat at https://gitter.im/biosustain/potion
:target: https://gitter.im/biosustain/potion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge|
.. image:: https://raw.githubusercontent.com/biosustain/potion/master/docs/_static/Potion.png
:alt: Flask-Potion
:align: center
:height: 150Description
===========**Flask-Potion** is a powerful Flask extension for building RESTful JSON APIs.
Potion features include validation, model resources and routes, relations, object permissions, filtering, sorting,
pagination, signals, and automatic API schema generation.Potion ships with backends for **SQLAlchemy**, **peewee** and **MongoEngine** models. It is possible to add backends for other data stores, or even to use a subset of Potion without any data store at all.
API client libraries for `Python `_ and `JavaScript/TypeScript `_ (generic Node as well as AngularJS and Angular) are available.
User's Guide
^^^^^^^^^^^^The user's guide and documentation is published here:
`http://potion.readthedocs.org/ `_
Versioning
^^^^^^^^^^Potion will use semantic versioning from v1.0.0. Until then, the minor version is used for changes known to be breaking.
Features
========- Powerful API framework both for data-store-linked and plain resources
- JSON-based and fully self-documenting with JSON Hyper-Schema
- Backend integrations:- Flask-SQLAlchemy
- Peewee (contributed by `Michael Lavers `_)
- Flask-MongoEngine- Filtering, sorting, pagination, validation, built right in
- Smart system for handling relations between resources
- Natural keys for extra simple relation querying
- Easy-to-use, yet highly flexible, optional permissions system
- Signals for pre- and post-processing of requests
- Very customizable — everything is just a resource, route, or schema
- Access APIs more easily with client libraries for `Python `_ and `JavaScript/TypeScript `_Example *(SQLAlchemy)*
======================.. code-block:: python
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_potion import Api, ModelResource, fields
from flask_potion.routes import ItemRouteapp = Flask(__name__)
db = SQLAlchemy(app)
api = Api(app)class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(), nullable=False)db.create_all()
class UserResource(ModelResource):
class Meta:
model = User@ItemRoute.GET
def greeting(self, user) -> fields.String():
return "Hello, {}!".format(user.name)api.add_resource(UserResource)
if __name__ == '__main__':
app.run()Authors
=======Potion is written and maintained by `Lars Schöning `_.
`Peewee `_ backend support has been contributed by `Michael Lavers `_.
`MongoEngine `_ backend support has been contributed by `João Cardoso `_.
`See here for the full list of contributors `_.