Skip to main content

Framework based on FastAPI.

Project description

UltraFramework

Description

Framework for FastAPI inspired by Java Spring.

  • It exposes a base entity class SQLEntity that can be derived in order to define custom entities.
  • It exposes a base repository class CRUDRepository[M] that can be derived in order to define custom repositories. The following public methods are available:
    • save(entity: M): M
    • find_all(limit: int | None, offset: int | None): Iterable[M]
    • delete(entity: M): None

Example:

from sqlalchemy.orm import mapped_column, Mapped
from sqlalchemy.sql.elements import ColumnElement
from ultra_framework.entities.sql_entity import SQLEntity
from ultra_framework.repositories.crud_repository import CRUDRepository


class UserEntity(SQLEntity):
  __tablename__ = "users"
  __table_args__ = {"schema": "myschema"}

  id: Mapped[int] = mapped_column(primary_key=True)
  name: Mapped[str]

  @classmethod
  def by_id(cls, idx: int) -> ColumnElement[bool]:
    return cls.id == idx


class UserRepository(CRUDRepository[UserEntity]):
  entity_class = UserEntity

  @CRUDRepository.auto_implement_one([UserEntity.by_id])
  def find_by_id(self, idx: int) -> UserEntity: ...

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

ultra_framework-0.0.10.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

ultra_framework-0.0.10-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file ultra_framework-0.0.10.tar.gz.

File metadata

  • Download URL: ultra_framework-0.0.10.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ultra_framework-0.0.10.tar.gz
Algorithm Hash digest
SHA256 48485f15dcb8b0593b42377a27ce65240b51c7cce03f60333b6e9cd7c3591348
MD5 49bb318ff1784117251e87b2584fb639
BLAKE2b-256 6e9db186e392fd4507f96a9b47cd2df80dc32327c9c8d92252ea2517e88de931

See more details on using hashes here.

File details

Details for the file ultra_framework-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for ultra_framework-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 cc5f13186949bf5987434da4446187fd4e4c84ddd7d45f9059fa5eb35b46ddb2
MD5 9b2a47141ed59134104f87b5ac20499a
BLAKE2b-256 4db3989ac9914b604bd10ab4941cd59fc31eb1e91019a80e9c6cc9483a02dd0b

See more details on using hashes here.

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