Skip to main content

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

datamodel_router-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datamodel_router-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file datamodel_router-1.0.0.tar.gz.

File metadata

  • Download URL: datamodel_router-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for datamodel_router-1.0.0.tar.gz
Algorithm Hash digest
SHA256 db6a9e914b9e0c25d3b0a899c1c3c1227a5323048fb0a63ffad2b495225e142d
MD5 96013521e70ceee2d1ffe91e37374c1a
BLAKE2b-256 b202b79d148f157cfb44988d1b28863dcf1cf09c88cceb5981ac0f85dcff8fee

See more details on using hashes here.

Provenance

The following attestation bundles were made for datamodel_router-1.0.0.tar.gz:

Publisher: python-publish.yml on TobiasAhlers/DataModel-Router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datamodel_router-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for datamodel_router-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 712bf70a3a794111871665a093d8e2c2e606dee78b0fa4125f4748f0ee564697
MD5 d6242ca9e07923f38766f350018dd7a8
BLAKE2b-256 fe0b7d6bae5e6dc85682f1077ab215e4ecad5ba6c1ecb89825f94ff361fd0bf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for datamodel_router-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on TobiasAhlers/DataModel-Router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page