{"id":13501513,"url":"https://github.com/python-restx/flask-restx","last_synced_at":"2025-05-15T01:04:03.165Z","repository":{"id":40380510,"uuid":"232805687","full_name":"python-restx/flask-restx","owner":"python-restx","description":"Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask","archived":false,"fork":false,"pushed_at":"2024-11-28T16:29:08.000Z","size":1695,"stargazers_count":2201,"open_issues_count":318,"forks_count":338,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-05-04T13:41:30.011Z","etag":null,"topics":["api","flask","json","python","rest","restful","restplus","restx","swagger"],"latest_commit_sha":null,"homepage":"https://flask-restx.readthedocs.io/en/latest/","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/python-restx.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-09T12:38:13.000Z","updated_at":"2025-05-03T18:52:48.000Z","dependencies_parsed_at":"2025-02-11T11:20:24.818Z","dependency_job_id":"73619b38-52bb-4ad1-8e7b-d624af25836e","html_url":"https://github.com/python-restx/flask-restx","commit_stats":{"total_commits":773,"total_committers":144,"mean_commits":5.368055555555555,"dds":0.4760672703751617,"last_synced_commit":"ad2210ce55ec1597639831631632c0019be826e8"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-restx%2Fflask-restx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-restx%2Fflask-restx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-restx%2Fflask-restx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-restx%2Fflask-restx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-restx","download_url":"https://codeload.github.com/python-restx/flask-restx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252542252,"owners_count":21764934,"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":["api","flask","json","python","rest","restful","restplus","restx","swagger"],"created_at":"2024-07-31T22:01:40.113Z","updated_at":"2025-05-07T12:49:01.805Z","avatar_url":"https://github.com/python-restx.png","language":"Python","readme":"===========\nFlask RESTX\n===========\n\n.. image:: https://github.com/python-restx/flask-restx/workflows/Tests/badge.svg?branch=master\u0026event=push\n    :target: https://github.com/python-restx/flask-restx/actions?query=workflow%3ATests\n    :alt: Tests status\n.. image:: https://codecov.io/gh/python-restx/flask-restx/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/python-restx/flask-restx\n    :alt: Code coverage\n.. image:: https://readthedocs.org/projects/flask-restx/badge/?version=latest\n    :target: https://flask-restx.readthedocs.io/en/latest/\n    :alt: Documentation status\n.. image:: https://img.shields.io/pypi/l/flask-restx.svg\n    :target: https://pypi.org/project/flask-restx\n    :alt: License\n.. image:: https://img.shields.io/pypi/pyversions/flask-restx.svg\n    :target: https://pypi.org/project/flask-restx\n    :alt: Supported Python versions\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n    :target: https://gitter.im/python-restx?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n    :alt: Join the chat at https://gitter.im/python-restx\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code style: black\n\n\nFlask-RESTX is a community driven fork of `Flask-RESTPlus \u003chttps://github.com/noirbizarre/flask-restplus\u003e`_.\n\n\nFlask-RESTX is an extension for `Flask`_ that adds support for quickly building REST APIs.\nFlask-RESTX encourages best practices with minimal setup.\nIf you are familiar with Flask, Flask-RESTX should be easy to pick up.\nIt provides a coherent collection of decorators and tools to describe your API\nand expose its documentation properly using `Swagger`_.\n\n\nCompatibility\n=============\n\nFlask-RESTX requires Python 3.9+.\n\nOn Flask Compatibility\n======================\n\nFlask and Werkzeug moved to versions 2.0 in March 2020. This caused a breaking change in Flask-RESTX.\n\n.. list-table:: RESTX and Flask / Werkzeug Compatibility\n    :widths: 25 25 25\n    :header-rows: 1\n\n\n    * - Flask-RESTX version\n      - Flask version\n      - Note\n    * - \u003c= 0.3.0\n      - \u003c 2.0.0\n      - unpinned in Flask-RESTX. Pin your projects!\n    * - == 0.4.0\n      - \u003c 2.0.0\n      - pinned in Flask-RESTX.\n    * - \u003e= 0.5.0\n      - \u003c 3.0.0\n      - unpinned, import statements wrapped for compatibility\n    * - == 1.2.0\n      - \u003c 3.0.0\n      - pinned in Flask-RESTX.\n    * - \u003e= 1.3.0\n      - \u003e= 2.0.0 (Flask \u003e= 3.0.0 support)\n      - unpinned, import statements wrapped for compatibility\n    * - trunk branch in Github\n      - \u003e= 2.0.0 (Flask \u003e= 3.0.0 support)\n      - unpinned, will address issues faster than releases.\n\nInstallation\n============\n\nYou can install Flask-RESTX with pip:\n\n.. code-block:: console\n\n    $ pip install flask-restx\n\nor with easy_install:\n\n.. code-block:: console\n\n    $ easy_install flask-restx\n\n\nQuick start\n===========\n\nWith Flask-RESTX, you only import the api instance to route and document your endpoints.\n\n.. code-block:: python\n\n    from flask import Flask\n    from flask_restx import Api, Resource, fields\n\n    app = Flask(__name__)\n    api = Api(app, version='1.0', title='TodoMVC API',\n        description='A simple TodoMVC API',\n    )\n\n    ns = api.namespace('todos', description='TODO operations')\n\n    todo = api.model('Todo', {\n        'id': fields.Integer(readonly=True, description='The task unique identifier'),\n        'task': fields.String(required=True, description='The task details')\n    })\n\n\n    class TodoDAO(object):\n        def __init__(self):\n            self.counter = 0\n            self.todos = []\n\n        def get(self, id):\n            for todo in self.todos:\n                if todo['id'] == id:\n                    return todo\n            api.abort(404, \"Todo {} doesn't exist\".format(id))\n\n        def create(self, data):\n            todo = data\n            todo['id'] = self.counter = self.counter + 1\n            self.todos.append(todo)\n            return todo\n\n        def update(self, id, data):\n            todo = self.get(id)\n            todo.update(data)\n            return todo\n\n        def delete(self, id):\n            todo = self.get(id)\n            self.todos.remove(todo)\n\n\n    DAO = TodoDAO()\n    DAO.create({'task': 'Build an API'})\n    DAO.create({'task': '?????'})\n    DAO.create({'task': 'profit!'})\n\n\n    @ns.route('/')\n    class TodoList(Resource):\n        '''Shows a list of all todos, and lets you POST to add new tasks'''\n        @ns.doc('list_todos')\n        @ns.marshal_list_with(todo)\n        def get(self):\n            '''List all tasks'''\n            return DAO.todos\n\n        @ns.doc('create_todo')\n        @ns.expect(todo)\n        @ns.marshal_with(todo, code=201)\n        def post(self):\n            '''Create a new task'''\n            return DAO.create(api.payload), 201\n\n\n    @ns.route('/\u003cint:id\u003e')\n    @ns.response(404, 'Todo not found')\n    @ns.param('id', 'The task identifier')\n    class Todo(Resource):\n        '''Show a single todo item and lets you delete them'''\n        @ns.doc('get_todo')\n        @ns.marshal_with(todo)\n        def get(self, id):\n            '''Fetch a given resource'''\n            return DAO.get(id)\n\n        @ns.doc('delete_todo')\n        @ns.response(204, 'Todo deleted')\n        def delete(self, id):\n            '''Delete a task given its identifier'''\n            DAO.delete(id)\n            return '', 204\n\n        @ns.expect(todo)\n        @ns.marshal_with(todo)\n        def put(self, id):\n            '''Update a task given its identifier'''\n            return DAO.update(id, api.payload)\n\n\n    if __name__ == '__main__':\n        app.run(debug=True)\n\n\nContributors\n============\n\nFlask-RESTX is brought to you by @python-restx. Since early 2019 @SteadBytes,\n@a-luna, @j5awry, @ziirish volunteered to help @python-restx keep the project up\nand running, they did so for a long time! Since the beginning of 2023, the project\nis maintained by @peter-doggart with help from @ziirish.\nOf course everyone is welcome to contribute and we will be happy to review your\nPR's or answer to your issues.\n\n\nDocumentation\n=============\n\nThe documentation is hosted `on Read the Docs \u003chttp://flask-restx.readthedocs.io/en/latest/\u003e`_\n\n\n.. _Flask: https://flask.palletsprojects.com/\n.. _Swagger: https://swagger.io/\n\n\nContribution\n============\nWant to contribute! That's awesome! Check out `CONTRIBUTING.rst! \u003chttps://github.com/python-restx/flask-restx/blob/master/CONTRIBUTING.rst\u003e`_\n","funding_links":[],"categories":["Python","HarmonyOS","APIs \u0026 Serialization","REST frameworks"],"sub_categories":["Windows Manager","More"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-restx%2Fflask-restx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-restx%2Fflask-restx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-restx%2Fflask-restx/lists"}