CRUD route generator for FastAPI
Project description
fastapi-crud-generator
Adds full CRUD routes to FastAPI without writing schemas, filters, or pagination by hand. Everything is generated automatically from your ORM model.
from fastapi_crud_generator import CRUDCollection
from fastapi_crud_generator.orm.sqlmodel import SQLModelAdapter
crud = CRUDCollection(orm_adapter=SQLModelAdapter(model=Article, get_session=get_session))
app.include_router(crud.get_router(prefix="/articles", tags=["articles"]))
Three lines — and five endpoints are ready with filtering, sorting, and pagination:
GET /articles ?title=…&published=true&sort=created_at:desc&page=1&per_page=20
GET /articles/{article_id}
POST /articles
PATCH /articles/{article_id}
DELETE /articles/{article_id}
Installation
If SQLModel, SQLAlchemy, or Tortoise is already in your project:
pip install fastapi-crud-generator
To install an ORM together with the package:
pip install "fastapi-crud-generator[sqlmodel]"
pip install "fastapi-crud-generator[sqlalchemy]"
pip install "fastapi-crud-generator[tortoise]"
Documentation
mozgsml.github.io/fastapi_crud_generator
- Getting Started — full working example from scratch
- Schema Generation — control which fields appear in each schema
- Nested Resources —
/threads/{id}/posts/{id} - Custom Adapter — connect your own ORM
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_crud_generator-0.0.1.tar.gz.
File metadata
- Download URL: fastapi_crud_generator-0.0.1.tar.gz
- Upload date:
- Size: 115.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
426327c586f468c7e30ce88f63c5469912eb8035ad8226d2fea5d87fa739515f
|
|
| MD5 |
d0074555caadf99e1116e2d771a0fa8d
|
|
| BLAKE2b-256 |
e7116ffc57548279001209375295dfa7b6d633c4bec482fb26e752ab4495424b
|
Provenance
The following attestation bundles were made for fastapi_crud_generator-0.0.1.tar.gz:
Publisher:
release.yml on mozgsml/fastapi_crud_generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_crud_generator-0.0.1.tar.gz -
Subject digest:
426327c586f468c7e30ce88f63c5469912eb8035ad8226d2fea5d87fa739515f - Sigstore transparency entry: 2061049211
- Sigstore integration time:
-
Permalink:
mozgsml/fastapi_crud_generator@0ae90c4c39d6bec92081bc735e97ec52b9c7bd89 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/mozgsml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ae90c4c39d6bec92081bc735e97ec52b9c7bd89 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fastapi_crud_generator-0.0.1-py3-none-any.whl.
File metadata
- Download URL: fastapi_crud_generator-0.0.1-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de242a2610d3a6ada99c2d85cf540a49a77f62715858536fea3c7ab172e1d43b
|
|
| MD5 |
93b6cb97e9d0fa477c30d725db4a74fe
|
|
| BLAKE2b-256 |
b968697e645ebf5e485dcf7f28d7a6b3f075c061416d63ba001f6b5f0dbfb37e
|
Provenance
The following attestation bundles were made for fastapi_crud_generator-0.0.1-py3-none-any.whl:
Publisher:
release.yml on mozgsml/fastapi_crud_generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_crud_generator-0.0.1-py3-none-any.whl -
Subject digest:
de242a2610d3a6ada99c2d85cf540a49a77f62715858536fea3c7ab172e1d43b - Sigstore transparency entry: 2061049659
- Sigstore integration time:
-
Permalink:
mozgsml/fastapi_crud_generator@0ae90c4c39d6bec92081bc735e97ec52b9c7bd89 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/mozgsml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ae90c4c39d6bec92081bc735e97ec52b9c7bd89 -
Trigger Event:
push
-
Statement type: