A simple router for data_models
Project description
DataModel-Router
DataModel-Router is a simple router for data models built with FastAPI and SQLModel. It provides a set of utilities and routes to manage data models efficiently.
Features
- Dynamic route generation for CRUD operations
- Query parameter validation
- Easy integration with FastAPI
Installation
To install the dependencies, run:
pip install -r
Usage
Define Your Data Model
Create a data model using DataModel-ORM:
from datamodel_orm import DataMode, Field
from typing import Optional
class TestDataModel(DataModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
name: str
age: int
Create and Include the Router
Create a router for your data model and include it in your FastAPI app:
from fastapi import FastAPI
from data_model_router import DataModelRouter
app = FastAPI()
app.include_router(DataModelRouter(TestDataModel))
Run the Application
Run your FastAPI application:
uvicorn main:app --reload
Project details
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 datamodel_router-2.0.0.tar.gz.
File metadata
- Download URL: datamodel_router-2.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a5d3f7d4d0abe413305a2a1c84333fd49053c122005c096d6d18559cf168997
|
|
| MD5 |
6cfb81f5c263b4774253ba59e0197f60
|
|
| BLAKE2b-256 |
53cb494b27600515f65909fc2d6bccfe8df7780f863905cb155d89f91faa9749
|
Provenance
The following attestation bundles were made for datamodel_router-2.0.0.tar.gz:
Publisher:
python-publish.yml on TobiasAhlers/DataModel-Router
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datamodel_router-2.0.0.tar.gz -
Subject digest:
5a5d3f7d4d0abe413305a2a1c84333fd49053c122005c096d6d18559cf168997 - Sigstore transparency entry: 177353464
- Sigstore integration time:
-
Permalink:
TobiasAhlers/DataModel-Router@05962fe112d9d9b8696117467b6d7617dfbc124c -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TobiasAhlers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@05962fe112d9d9b8696117467b6d7617dfbc124c -
Trigger Event:
release
-
Statement type:
File details
Details for the file datamodel_router-2.0.0-py3-none-any.whl.
File metadata
- Download URL: datamodel_router-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f32881f0de5d69a3f4d617dd51cd6f95820f9412ea52c9ffb72d57c778b22b0
|
|
| MD5 |
d4524e77bf55d0a5e5d3e4b71291d177
|
|
| BLAKE2b-256 |
4ff107accdf56f90bb72907a63716d354e95fb9cb8914cd3ab9ff89e95824399
|
Provenance
The following attestation bundles were made for datamodel_router-2.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on TobiasAhlers/DataModel-Router
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datamodel_router-2.0.0-py3-none-any.whl -
Subject digest:
3f32881f0de5d69a3f4d617dd51cd6f95820f9412ea52c9ffb72d57c778b22b0 - Sigstore transparency entry: 177353482
- Sigstore integration time:
-
Permalink:
TobiasAhlers/DataModel-Router@05962fe112d9d9b8696117467b6d7617dfbc124c -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TobiasAhlers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@05962fe112d9d9b8696117467b6d7617dfbc124c -
Trigger Event:
release
-
Statement type: