<p align="center">
<img src="https://raw.githubusercontent.com/awtkns/fastapi-crudrouter/master/docs/en/docs/assets/logo.png" height="200" />
</p>
<p align="center">
<em>⚡ Create CRUD routes with lighting speed</em> ⚡</br>
<sub>A dynamic FastAPI router that automatically creates CRUD routes for your models</sub>
</p>
<p align="center">
<img alt="Tests" src="https://img.shields.io/github/actions/workflow/status/awtkns/fastapi-crudrouter/.github/workflows/pytest.yml?color=%2334D058" />
<img alt="Downloads" src="https://img.shields.io/pypi/dm/fastapi-crudrouter?color=%2334D058" />
<a href="https://pypi.org/project/fastapi-crudrouter" target="_blank">
<img src="https://img.shields.io/pypi/v/fastapi-crudrouter?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<img alt="License" src="https://img.shields.io/github/license/awtkns/fastapi-crudrouter?color=%2334D058" />
</p>
<p align="center">
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/fastapi-crudrouter">
</p>
---
**Documentation**: <a href="https://fastapi-crudrouter.awtkns.com" target="_blank">https://fastapi-crudrouter.awtkns.com</a>
**Source Code**: <a href="https://github.com/awtkns/fastapi-crudrouter" target="_blank">https://github.com/awtkns/fastapi-crudrouter</a>
---
Tired of rewriting generic CRUD routes? Need to rapidly prototype a feature for a presentation
or a hackathon? Thankfully, [fastapi-crudrouter](https://github.com/awtkns/fastapi-crudrouter) has your back. As an
extension to the APIRouter included with [FastAPI](https://fastapi.tiangolo.com/), the FastAPI CRUDRouter will automatically
generate and document your CRUD routes for you, all you have to do is pass your model and maybe your database connection.
FastAPI-CRUDRouter is **lighting fast**, well tested, and **production ready**.
## Installation
```bash
pip install fastapi-crudrouter
```
## Basic Usage
Below is a simple example of what the CRUDRouter can do. In just ten lines of code, you can generate all
the crud routes you need for any model. A full list of the routes generated can be found [here](https://fastapi-crudrouter.awtkns.com/routing).
```python
from pydantic import BaseModel
from fastapi import FastAPI
from fastapi_crudrouter import MemoryCRUDRouter as CRUDRouter
class Potato(BaseModel):
id: int
color: str
mass: float
app = FastAPI()
app.include_router(CRUDRouter(schema=Potato))
```
## Advanced Usage
fastapi-crudrouter provides a number of features that allow you to get the most out of your automatically generated CRUD
routes. Listed below are some highlights.
- Automatic Pagination ([docs](https://fastapi-crudrouter.awtkns.com/pagination/))
- Ability to Provide Custom Create and Update Schemas ([docs](https://fastapi-crudrouter.awtkns.com/schemas/))
- Dynamic Generation of Create and Update Schemas ([docs](https://fastapi-crudrouter.awtkns.com/schemas/))
- Ability to Add, Customize, or Disable Specific Routes ([docs](https://fastapi-crudrouter.awtkns.com/routing/))
- Native Support for FastAPI Dependency Injection ([docs](https://fastapi-crudrouter.awtkns.com/dependencies/))
## Supported Backends / ORMs
fastapi-crudrouter currently supports a number of backends / ORMs. Listed below are the backends currently supported. This list will
likely grow in future releases.
- In Memory ([docs](https://fastapi-crudrouter.awtkns.com/backends/memory/))
- SQLAlchemy ([docs](https://fastapi-crudrouter.awtkns.com/backends/sqlalchemy/))
- Databases (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/async/))
- Gino (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/gino.html))
- Ormar (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/ormar/))
- Tortoise ORM (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/tortoise/))
## OpenAPI Support
By default, all routes generated by the CRUDRouter will be documented according to OpenAPI spec.
Below are the default routes created by the CRUDRouter shown in the generated OpenAPI documentation.
![OpenAPI Route Overview](https://raw.githubusercontent.com/awtkns/fastapi-crudrouter/master/docs/en/docs/assets/RouteOverview.png)
The CRUDRouter is able to dynamically generate detailed documentation based on the models given to it.
![OpenAPI Route Detail](https://raw.githubusercontent.com/awtkns/fastapi-crudrouter/master/docs/en/docs/assets/RouteDetail.png)
Raw data
{
"_id": null,
"home_page": "https://github.com/as3445/fastapi-crudrouter",
"name": "fastapi-crudrouter-as3445",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "fastapi, crud, restful, routing, generator, crudrouter",
"author": "Adam Watkins",
"author_email": "hello@awtkns.com",
"download_url": "https://files.pythonhosted.org/packages/6d/94/c1dd20fe5d4b5da2a4e46d843bb6e9d416dfe554eba6cd0f8003fc4c4037/fastapi-crudrouter-as3445-0.8.8.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/awtkns/fastapi-crudrouter/master/docs/en/docs/assets/logo.png\" height=\"200\" />\n</p>\n<p align=\"center\">\n <em>\u26a1 Create CRUD routes with lighting speed</em> \u26a1</br>\n <sub>A dynamic FastAPI router that automatically creates CRUD routes for your models</sub>\n</p>\n<p align=\"center\">\n<img alt=\"Tests\" src=\"https://img.shields.io/github/actions/workflow/status/awtkns/fastapi-crudrouter/.github/workflows/pytest.yml?color=%2334D058\" />\n<img alt=\"Downloads\" src=\"https://img.shields.io/pypi/dm/fastapi-crudrouter?color=%2334D058\" />\n <a href=\"https://pypi.org/project/fastapi-crudrouter\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/fastapi-crudrouter?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n <img alt=\"License\" src=\"https://img.shields.io/github/license/awtkns/fastapi-crudrouter?color=%2334D058\" />\n</p>\n<p align=\"center\">\n<img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/fastapi-crudrouter\">\n</p>\n\n---\n\n**Documentation**: <a href=\"https://fastapi-crudrouter.awtkns.com\" target=\"_blank\">https://fastapi-crudrouter.awtkns.com</a>\n\n**Source Code**: <a href=\"https://github.com/awtkns/fastapi-crudrouter\" target=\"_blank\">https://github.com/awtkns/fastapi-crudrouter</a>\n\n---\nTired of rewriting generic CRUD routes? Need to rapidly prototype a feature for a presentation\nor a hackathon? Thankfully, [fastapi-crudrouter](https://github.com/awtkns/fastapi-crudrouter) has your back. As an \nextension to the APIRouter included with [FastAPI](https://fastapi.tiangolo.com/), the FastAPI CRUDRouter will automatically\ngenerate and document your CRUD routes for you, all you have to do is pass your model and maybe your database connection.\n\nFastAPI-CRUDRouter is **lighting fast**, well tested, and **production ready**.\n\n\n## Installation\n```bash\npip install fastapi-crudrouter\n```\n\n## Basic Usage\nBelow is a simple example of what the CRUDRouter can do. In just ten lines of code, you can generate all \nthe crud routes you need for any model. A full list of the routes generated can be found [here](https://fastapi-crudrouter.awtkns.com/routing).\n\n```python\nfrom pydantic import BaseModel\nfrom fastapi import FastAPI\nfrom fastapi_crudrouter import MemoryCRUDRouter as CRUDRouter\n\nclass Potato(BaseModel):\n id: int\n color: str\n mass: float\n\napp = FastAPI()\napp.include_router(CRUDRouter(schema=Potato))\n```\n\n## Advanced Usage\nfastapi-crudrouter provides a number of features that allow you to get the most out of your automatically generated CRUD\nroutes. Listed below are some highlights.\n\n- Automatic Pagination ([docs](https://fastapi-crudrouter.awtkns.com/pagination/))\n- Ability to Provide Custom Create and Update Schemas ([docs](https://fastapi-crudrouter.awtkns.com/schemas/))\n- Dynamic Generation of Create and Update Schemas ([docs](https://fastapi-crudrouter.awtkns.com/schemas/))\n- Ability to Add, Customize, or Disable Specific Routes ([docs](https://fastapi-crudrouter.awtkns.com/routing/))\n- Native Support for FastAPI Dependency Injection ([docs](https://fastapi-crudrouter.awtkns.com/dependencies/))\n\n## Supported Backends / ORMs\nfastapi-crudrouter currently supports a number of backends / ORMs. Listed below are the backends currently supported. This list will\nlikely grow in future releases.\n\n- In Memory ([docs](https://fastapi-crudrouter.awtkns.com/backends/memory/))\n- SQLAlchemy ([docs](https://fastapi-crudrouter.awtkns.com/backends/sqlalchemy/))\n- Databases (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/async/))\n- Gino (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/gino.html)) \n- Ormar (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/ormar/))\n- Tortoise ORM (async) ([docs](https://fastapi-crudrouter.awtkns.com/backends/tortoise/))\n\n## OpenAPI Support\nBy default, all routes generated by the CRUDRouter will be documented according to OpenAPI spec.\n\nBelow are the default routes created by the CRUDRouter shown in the generated OpenAPI documentation.\n\n![OpenAPI Route Overview](https://raw.githubusercontent.com/awtkns/fastapi-crudrouter/master/docs/en/docs/assets/RouteOverview.png)\n\nThe CRUDRouter is able to dynamically generate detailed documentation based on the models given to it.\n\n![OpenAPI Route Detail](https://raw.githubusercontent.com/awtkns/fastapi-crudrouter/master/docs/en/docs/assets/RouteDetail.png)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A dynamic FastAPI router that automatically creates CRUD routes for your models",
"version": "0.8.8",
"project_urls": {
"Homepage": "https://github.com/as3445/fastapi-crudrouter"
},
"split_keywords": [
"fastapi",
" crud",
" restful",
" routing",
" generator",
" crudrouter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4841ba2abc126c23d7d0c231c2453ec25eacba343797c4f6fc7b37c7aa5ae5e5",
"md5": "8e02a7d3861443e2b6825ce2148efbc5",
"sha256": "da44e80b5ade920a137f1bd3694b7b3d9d97317270efa197218174ed53d8b67f"
},
"downloads": -1,
"filename": "fastapi_crudrouter_as3445-0.8.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e02a7d3861443e2b6825ce2148efbc5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 16351,
"upload_time": "2024-07-17T04:53:26",
"upload_time_iso_8601": "2024-07-17T04:53:26.486425Z",
"url": "https://files.pythonhosted.org/packages/48/41/ba2abc126c23d7d0c231c2453ec25eacba343797c4f6fc7b37c7aa5ae5e5/fastapi_crudrouter_as3445-0.8.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6d94c1dd20fe5d4b5da2a4e46d843bb6e9d416dfe554eba6cd0f8003fc4c4037",
"md5": "0fb746123d6c3ad154a80af4b9893cee",
"sha256": "6db1f21cc517d0dec9f9494411c597c52891ed5530291a2a6bc0515a23014a69"
},
"downloads": -1,
"filename": "fastapi-crudrouter-as3445-0.8.8.tar.gz",
"has_sig": false,
"md5_digest": "0fb746123d6c3ad154a80af4b9893cee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 12454,
"upload_time": "2024-07-17T04:53:27",
"upload_time_iso_8601": "2024-07-17T04:53:27.889390Z",
"url": "https://files.pythonhosted.org/packages/6d/94/c1dd20fe5d4b5da2a4e46d843bb6e9d416dfe554eba6cd0f8003fc4c4037/fastapi-crudrouter-as3445-0.8.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-17 04:53:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "as3445",
"github_project": "fastapi-crudrouter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "fastapi",
"specs": [
[
">=",
"0.101.1"
]
]
}
],
"lcname": "fastapi-crudrouter-as3445"
}