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.6.tar.gz
(6.1 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.6.tar.gz.
File metadata
- Download URL: ultra_framework-0.0.6.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61876e3e9a7d46c8b2fcbe95c028d2cd1904c0c5bae077a5585482aaa8d64d94
|
|
| MD5 |
15b9835dd9c9dd5fa6d05bf3b079a016
|
|
| BLAKE2b-256 |
f6884c82a9b831a6d0a3e831d2eca9af77665f81d70e0e93c3d17dba2f69d92b
|
File details
Details for the file ultra_framework-0.0.6-py3-none-any.whl.
File metadata
- Download URL: ultra_framework-0.0.6-py3-none-any.whl
- Upload date:
- Size: 7.9 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 |
8735cbb585ce2cd0601f76f35b7fe41f6e4da242209fc34c184be2cebfadbd29
|
|
| MD5 |
f29f66997ec09cd8b9e7c3f4b8161762
|
|
| BLAKE2b-256 |
9260177b5f5d8ce0aaa14727aca873de714cee534c6dc32f6d94bdf0fde10be3
|