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(): None
- find_all(): None
- delete(): 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.4.tar.gz
(5.9 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.4.tar.gz.
File metadata
- Download URL: ultra_framework-0.0.4.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39c942f8f05e65cd9de70237272b1a119d333e1dd32de94048b4153a6ca369d0
|
|
| MD5 |
2f9804021e507adf9da77e4cb138c7ac
|
|
| BLAKE2b-256 |
b973ef4432afff8856f8c8c89a20530a9a992a00378d59e0cf2f6d25b11dd952
|
File details
Details for the file ultra_framework-0.0.4-py3-none-any.whl.
File metadata
- Download URL: ultra_framework-0.0.4-py3-none-any.whl
- Upload date:
- Size: 7.7 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 |
b91579221233f6417cdf69759dfa3468d25dc810fa262f6fd5066b95a5caff4f
|
|
| MD5 |
70a1c51a0f1298dbc361728311dd2932
|
|
| BLAKE2b-256 |
52a287ac98775309b6d2d11ddaaae725c9aa288289852cde20e264dbe6a4032e
|