Skip to main content

Small, but usefull library for interaction with Ormar ORM

Project description

FASTAPI-ORMAR-UTILITIES

Small package for better interaction with Ormar ORM.

This package makes your views cleaner

Features:

  • Fully async
  • Compatible with FastAPI
  • In my opinion Ormar is the best ORM for FastAPI

Install with pip

pip install fastapi-ormar-utilities

Example usage:

from fastapi import APIRouter, Depends
from fastapi_ormar_utilities import Base

from .models import Item # import Ormar model
from .schemas import ItemCreate # import Pydantic model

router = APIRouter()

class ItemService(Base):
    model = Item

@router.get('/')
async def get_items(
    service: ItemService = Depends()
):
    return await service.fetch_all()

@router.post('/')
async def create_item(
    item_data: ItemCreate,
    service: ItemService = Depends()
):
    return await service.create(item_data)

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

fastapi-ormar-utilities-0.0.9.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

fastapi_ormar_utilities-0.0.9-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi-ormar-utilities-0.0.9.tar.gz.

File metadata

  • Download URL: fastapi-ormar-utilities-0.0.9.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for fastapi-ormar-utilities-0.0.9.tar.gz
Algorithm Hash digest
SHA256 9b9c089fb196f22e01870ee90ddd21da3885afb4fc5a4680c08ea6fe92cb27e9
MD5 ac720cc49c24a09b1c4f02b8e62cac53
BLAKE2b-256 3fc3cc7aff5498165aa01620d9fa0df6c0e7c876ba788173d5990694fcf2c190

See more details on using hashes here.

File details

Details for the file fastapi_ormar_utilities-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: fastapi_ormar_utilities-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for fastapi_ormar_utilities-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 69cc4f9f3ae1e989e6b83b497114c4b0bceaf04e3053ff284312618faf2e9356
MD5 6fddea766c82aeed170f7b15496f58d2
BLAKE2b-256 830a676434fc51fe163f8b9f8268fa9d2c2cec21e2d37ac726ea32f1a21b22fc

See more details on using hashes here.

Supported by

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