fastapi-crudrouter


Namefastapi-crudrouter JSON
Version 0.8.6 PyPI version JSON
download
home_pagehttps://github.com/awtkns/fastapi-crudrouter
SummaryA dynamic FastAPI router that automatically creates CRUD routes for your models
upload_time2023-01-28 08:44:45
maintainer
docs_urlNone
authorAdam Watkins
requires_python>=3.7
licenseMIT
keywords fastapi crud restful routing generator crudrouter
VCS
bugtrack_url
requirements fastapi
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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/awtkns/fastapi-crudrouter",
    "name": "fastapi-crudrouter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "fastapi,crud,restful,routing,generator,crudrouter",
    "author": "Adam Watkins",
    "author_email": "hello@awtkns.com",
    "download_url": "https://files.pythonhosted.org/packages/20/f0/236c71f45d908f7eff879d9002b23449c7c02bd815856ff8e238cbc008e6/fastapi-crudrouter-0.8.6.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.6",
    "split_keywords": [
        "fastapi",
        "crud",
        "restful",
        "routing",
        "generator",
        "crudrouter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "550c68fe05b1b77fa2d71c44228028acab50d1ccfcd7dd5dd21913da33182375",
                "md5": "bfdc7c8adad56d017943fb9d2f90fae7",
                "sha256": "4ceb0289cd7b7c687f88581838c032cdb21f24d36971e54b0e594ddcfaf9634e"
            },
            "downloads": -1,
            "filename": "fastapi_crudrouter-0.8.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bfdc7c8adad56d017943fb9d2f90fae7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 16261,
            "upload_time": "2023-01-28T08:44:44",
            "upload_time_iso_8601": "2023-01-28T08:44:44.027965Z",
            "url": "https://files.pythonhosted.org/packages/55/0c/68fe05b1b77fa2d71c44228028acab50d1ccfcd7dd5dd21913da33182375/fastapi_crudrouter-0.8.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20f0236c71f45d908f7eff879d9002b23449c7c02bd815856ff8e238cbc008e6",
                "md5": "773cec665c6d30b8964b680a274c137b",
                "sha256": "32704a7aa1d0b23bb6437f717599e9c4c01d8e5a91370a0359837a899a809ceb"
            },
            "downloads": -1,
            "filename": "fastapi-crudrouter-0.8.6.tar.gz",
            "has_sig": false,
            "md5_digest": "773cec665c6d30b8964b680a274c137b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12311,
            "upload_time": "2023-01-28T08:44:45",
            "upload_time_iso_8601": "2023-01-28T08:44:45.800651Z",
            "url": "https://files.pythonhosted.org/packages/20/f0/236c71f45d908f7eff879d9002b23449c7c02bd815856ff8e238cbc008e6/fastapi-crudrouter-0.8.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-28 08:44:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "awtkns",
    "github_project": "fastapi-crudrouter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "fastapi",
            "specs": [
                [
                    ">=",
                    "0.62.0"
                ]
            ]
        }
    ],
    "lcname": "fastapi-crudrouter"
}
        
Elapsed time: 0.51013s