Skip to content

v0.3.0 - Initial Release

Compare
Choose a tag to compare
@awtkns awtkns released this 04 Jan 05:00
· 405 commits to master since this release

🎉 Initial Release 🎉

Tired of rewriting the same generic CRUD routes? Need to rapidly prototype a feature for a presentation or a hackathon? Thankfully, fastapi-crudrouter has your back. As an extension to the APIRouter included with FastAPI, the FastAPI CRUDRouter will automatically generate and document your CRUD routes for you.

Documentation: https://fastapi-crudrouter.awtkns.com

Source Code: https://github.com/awtkns/fastapi-crudrouter

Installation

pip install fastapi_crudrouter

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.

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(model=Potato))

Features

  • Automatic pydantic model based route generation and documentation (Docs)
  • Ability to customize any of the generated routes (Docs)
  • Authorization and FastAPI dependency support (Docs)
  • Support for both async and non-async relational databases using SQLAlchemy (Docs)
  • Extensive documentation.
  • And much more 😎