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.3.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.3.tar.gz.
File metadata
- Download URL: ultra_framework-0.0.3.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 |
c2a757bc577d9b969dc614c457ca41506d46d3f0e421942922d7f88575121ec2
|
|
| MD5 |
dcdce021c97ecce2d4962ad97991943d
|
|
| BLAKE2b-256 |
3a696c2d18ecbd707f7975659190334319c10a64224dd02f79a40ee3f90655ce
|
File details
Details for the file ultra_framework-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ultra_framework-0.0.3-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 |
07a52a64a0f368b055d4d487cae5406cdd91f86c03bc210ea76707384401b315
|
|
| MD5 |
b4045c5e6412a13090799de300449cd6
|
|
| BLAKE2b-256 |
d317da9ee50de8857770ea3c4ef8d37d04cfca8458e6b11606a81fceb015b746
|