Generate FastAPI route modules from SQLAlchemy-backed ExDataset metadata.
Project description
exdrf-gen-al2r
exdrf-gen-al2r is an exdrf-gen plugin that emits FastAPI
APIRouter stubs from SQLAlchemy-backed ExDataset metadata. List and
read handlers are typed with XxxEx; create uses XxxCreate. Patch
is emitted only when exdrf-gen-al2pd would emit XxxEdit (composite
PK–only link tables skip PATCH).
Python 3.12.2+ is required.
Command-line usage
exdrf-gen al2r DATASET OUT-PATH DB-MODULE SCHEMAS-PKG
Or: python -m exdrf_gen al2r ....
- DATASET —
module.path:DeclarativeBase. - OUT-PATH — directory for
*_routes.pyand__init__.py(orEXDRF_AL2R_PATH). - DB-MODULE — dotted import path for ORM classes (
from DB-MODULE import Model). - SCHEMAS-PKG — dotted root package where
al2pdwrote schemas (orEXDRF_AL2R_SCHEMAS). Import path per resource isSCHEMAS-PKG.<categories...>.<snake_case_name_plural>(e.g.myapp.schemas.widgetsforWidgetat the root category).
Path parameters for GET/PATCH follow resource.primary_fields() order
(e.g. {left_id}/{right_id} for composite keys).
Dependencies
exdrf-gen, exdrf-al, click, exdrf-gen-al2pd (for
resource_generates_edit_payload). Generated routers import FastAPI and
SQLAlchemy — add those to the application environment.
Plugin registration
[project.entry-points.'exdrf.plugins']
exdrf_gen = 'exdrf_gen_al2r'
See also
exdrf-gen-al2pd— generates the Pydantic modulesal2rimports.exdrf-gen—README.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 exdrf_gen_al2r-0.1.11-py3-none-any.whl.
File metadata
- Download URL: exdrf_gen_al2r-0.1.11-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
820ec9e0a279dbd9cd344e4f6295739ce1f2cf5f65151b4b4435b43f7abe510c
|
|
| MD5 |
e3050702201a0e1f290d97b042a5f108
|
|
| BLAKE2b-256 |
6f2438a40e68c9cb5ec0d1b95cf1834c0ea6abc340ccf80a8219faf32eda3955
|