{"id":13421550,"url":"https://github.com/biosustain/potion","last_synced_at":"2025-04-05T13:07:39.765Z","repository":{"id":20764782,"uuid":"24049454","full_name":"biosustain/potion","owner":"biosustain","description":"Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine","archived":false,"fork":false,"pushed_at":"2019-04-23T17:00:39.000Z","size":661,"stargazers_count":488,"open_issues_count":51,"forks_count":50,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T12:07:50.432Z","etag":null,"topics":["flask","flask-extensions","mongoengine","peewee","sqlalchemy"],"latest_commit_sha":null,"homepage":"http://potion.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/biosustain.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-15T08:52:47.000Z","updated_at":"2025-02-12T06:37:00.000Z","dependencies_parsed_at":"2022-07-07T15:58:35.568Z","dependency_job_id":null,"html_url":"https://github.com/biosustain/potion","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biosustain%2Fpotion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biosustain%2Fpotion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biosustain%2Fpotion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biosustain%2Fpotion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biosustain","download_url":"https://codeload.github.com/biosustain/potion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","flask-extensions","mongoengine","peewee","sqlalchemy"],"created_at":"2024-07-30T23:00:24.837Z","updated_at":"2025-04-05T13:07:39.744Z","avatar_url":"https://github.com/biosustain.png","language":"Python","readme":"============\nFlask-Potion\n============\n\n\n.. image:: https://img.shields.io/travis/biosustain/potion/master.svg?style=flat-square\n    :target: https://travis-ci.org/biosustain/potion\n\n.. image:: https://img.shields.io/coveralls/biosustain/potion/master.svg?style=flat-square\n    :target: https://coveralls.io/r/biosustain/potion\n\n.. image:: https://img.shields.io/pypi/v/Flask-Potion.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/Flask-Potion\n\n.. image:: https://img.shields.io/pypi/l/Flask-Potion.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/Flask-Potion\n\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n   :alt: Join the chat at https://gitter.im/biosustain/potion\n   :target: https://gitter.im/biosustain/potion?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n\n|\n\n.. image:: https://raw.githubusercontent.com/biosustain/potion/master/docs/_static/Potion.png\n   :alt: Flask-Potion\n   :align: center\n   :height: 150\n\n\nDescription\n===========\n\n**Flask-Potion** is a powerful Flask extension for building RESTful JSON APIs.\nPotion features include validation, model resources and routes, relations, object permissions, filtering, sorting,\npagination, signals, and automatic API schema generation.\n\nPotion 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.\n\nAPI client libraries for `Python \u003chttps://github.com/biosustain/potion-client\u003e`_ and `JavaScript/TypeScript \u003chttps://github.com/biosustain/potion-node\u003e`_ (generic Node as well as AngularJS and Angular) are available.\n\nUser's Guide\n^^^^^^^^^^^^\n\nThe user's guide and documentation is published here:\n\n   `http://potion.readthedocs.org/ \u003chttp://potion.readthedocs.org/en/latest/\u003e`_\n\nVersioning\n^^^^^^^^^^\n\nPotion will use semantic versioning from v1.0.0. Until then, the minor version is used for changes known to be breaking.\n\nFeatures\n========\n\n- Powerful API framework both for data-store-linked and plain resources\n- JSON-based and fully self-documenting with JSON Hyper-Schema\n- Backend integrations:\n\n  - Flask-SQLAlchemy\n  - Peewee (contributed by `Michael Lavers \u003chttps://github.com/kolanos\u003e`_)\n  - Flask-MongoEngine\n\n- Filtering, sorting, pagination, validation, built right in\n- Smart system for handling relations between resources\n- Natural keys for extra simple relation querying\n- Easy-to-use, yet highly flexible, optional permissions system\n- Signals for pre- and post-processing of requests\n- Very customizable — everything is just a resource, route, or schema\n- Access APIs more easily with client libraries for `Python \u003chttps://github.com/biosustain/potion-client\u003e`_ and `JavaScript/TypeScript \u003chttps://github.com/biosustain/potion-node\u003e`_\n\n\nExample *(SQLAlchemy)*\n======================\n\n.. code-block:: python\n\n    from flask import Flask\n    from flask_sqlalchemy import SQLAlchemy\n    from flask_potion import Api, ModelResource, fields\n    from flask_potion.routes import ItemRoute\n\n    app = Flask(__name__)\n    db = SQLAlchemy(app)\n    api = Api(app)\n\n    class User(db.Model):\n        id = db.Column(db.Integer, primary_key=True)\n        name = db.Column(db.String(), nullable=False)\n\n    db.create_all()\n\n    class UserResource(ModelResource):\n        class Meta:\n            model = User\n\n        @ItemRoute.GET\n        def greeting(self, user) -\u003e fields.String():\n            return \"Hello, {}!\".format(user.name)\n\n    api.add_resource(UserResource)\n\n    if __name__ == '__main__':\n        app.run()\n\n\nAuthors\n=======\n\nPotion is written and maintained by `Lars Schöning \u003chttps://github.com/lyschoening\u003e`_.\n\n`Peewee \u003chttps://peewee.readthedocs.org/en/latest/\u003e`_ backend support has been contributed by `Michael Lavers \u003chttps://github.com/kolanos\u003e`_.\n\n`MongoEngine \u003chttp://mongoengine.org/\u003e`_ backend support has been contributed by `João Cardoso \u003chttps://github.com/joaocardoso\u003e`_.\n\n`See here for the full list of contributors \u003chttps://github.com/biosustain/potion/graphs/contributors\u003e`_.\n","funding_links":[],"categories":["Python","Servers","Ranked by starred repositories","Framework","介绍"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiosustain%2Fpotion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiosustain%2Fpotion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiosustain%2Fpotion/lists"}