BetterCRUD Library Generates Full FastAPI CRUD API From a Single Python Decorator
A Python library called BetterCRUD aims to eliminate repetitive boilerplate code in FastAPI projects by auto-generating a complete CRUD API layer from a single decorator. Applying the decorator to a controller class produces eight ready-to-use routes, covering list, create, bulk create, update, bulk update, delete, and soft-delete recovery operations. The generated endpoints include built-in support for 27 filter operators, pagination modes, and sorting, removing the need to implement these features manually per endpoint. The library integrates with async SQLAlchemy and requires developers to define only a model, Pydantic schemas, and a thin service class. All generated routes are automatically documented via OpenAPI and Swagger, and global or per-route configuration is available through a centralised config initialiser.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in