Skip to main content

web_fractal

Конструктор веб-приложений поверх SQLAlchemy и Pydantic: типобезопасный DSL фильтров, CRUD-миксины, ABAC-правила доступа, контроллеры для нескольких транспортов. Ядро не привязано к веб-фреймворку — интеграции подключаются экстрами.

pip install web_fractal              # ядро: db, dtos, filters, mixins, security
pip install "web_fractal[fastapi]"   # + контроллеры и сборка FastAPI-приложения

Что внутри

Модуль Зачем
web_fractal.db Base, UnitOfWork, paginate, apply_filters, copy_object
web_fractal.dtos Pydantic-база с .not_blank, Pagination, MessageDTO
web_fractal.types Unset/UNSET — sentinel «не фильтровать», в отличие от None
web_fractal.filters FilterBase + FilterField[T]: DSL фильтрации с автогенерацией query-параметров
web_fractal.mixins GenericRepo, GenericService — CRUD без копипасты
web_fractal.core.security ABAC: SecurityContext, AccessRule, RowRule, FieldScope
web_fractal.http HttpControllerABC, AutoHttpController (требует экстру fastapi)
web_fractal.building_utils Сборка FastAPI-приложения из archtool-инжектора (экстра fastapi)
web_fractal.transports Контроллеры Kafka / gRPC / GraphQL (свои экстры)

Фильтры

from web_fractal.filters import FilterBase, FilterField

class UserFilter(FilterBase):
    name: FilterField[str]
    age: FilterField[int]

# FastAPI-зависимость с явными query-параметрами в Swagger
UserFilterDep = UserFilter.as_fastapi_dep()

Единица работы

from web_fractal.db import UnitOfWork

async with UnitOfWork(session_maker) as uow:
    session = uow.get_session()
    ...
    await session.commit()

Экстры

Экстра Что включает
fastapi HTTP-контроллеры, middlewares, сборка приложения
aiohttp utils.download_large_file
kafka, grpc, graphql соответствующие транспорты
django адаптеры для Django-проектов

Пакет не импортирует подмодули на загрузке (PEP 562): import web_fractal.db не требует ни FastAPI, ни aiohttp. Публичные имена доступны и из корня — from web_fractal import UnitOfWork — но резолвятся лениво, при первом обращении.

Разработка

uv sync --extra dev
pytest

MIT.

Metadata

Release files for web-fractal 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for web-fractal 0.2.1
File Size Uploaded Provenance Actions
web_fractal-0.2.1.tar.gz 60.5 kB Without provenance Details for web_fractal-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for web-fractal 0.2.1
File Interpreter ABI Platform Actions
web_fractal-0.2.1-py3-none-any.whl Python 3 none any Details for web_fractal-0.2.1-py3-none-any.whl

Total release size: 108.2 kB

Release files / web_fractal-0.2.1.tar.gz

Download URL web_fractal-0.2.1.tar.gz
Size 60.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d593c8179d203bf7b5b1a211ddbec14f35106c7c34d34571db9bc06858f5782d
BLAKE2b-256 checksum
How to use checksums
5e2c47c40a9de2dca176053693fd10ce1548513d5dde8b8aeb03c1d746f28c0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / web_fractal-0.2.1-py3-none-any.whl

Download URL web_fractal-0.2.1-py3-none-any.whl
Size 47.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
007c90b543128af6d14cfeaa51f0c1832548870b1edd2512e5af80e429c08459
BLAKE2b-256 checksum
How to use checksums
5aa2833ba01967f3bcb4ef5d15a7b17d82288a2e257c83c8b9e87c14d68c7b24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for web-fractal 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page