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
Release history Release notifications | RSS feed
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.7.tar.gz
(6.2 kB
view details)
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 ultra_framework-0.0.7.tar.gz.
File metadata
- Download URL: ultra_framework-0.0.7.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18601c120b1cc2a2013b2ada132bee067d655a3fc06bd7ba294048a1e1178d43
|
|
| MD5 |
79efbfd90f8980bdd241cde1bf524a9d
|
|
| BLAKE2b-256 |
4ac7785eb339897f97d82b8d0f2a6ef8bf08b382b8b19ec7394f743039c6be0d
|
File details
Details for the file ultra_framework-0.0.7-py3-none-any.whl.
File metadata
- Download URL: ultra_framework-0.0.7-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41fd9ccacf69337040bc9da4c69a5db38ed6988e750d3e4bd85a17ba3948cbb5
|
|
| MD5 |
33be3c8693fe374d37caede67220570f
|
|
| BLAKE2b-256 |
a583f238bac115aa0a24e608e91d7bf433fc43639a4ce2b3884f2b75e743d338
|