Loading

Kribton is a lightweight ASGI web framework built from scratch for developers who want to create APIs without fighting boilerplate. It pairs a typed routing system with a thin, async-first ORM layer on top of SQLAlchemy, giving you request handling, path parameter validation, and full CRUD database access out of the box — while staying small enough to read the entire source in an afternoon.
View SourceRoutes support path parameters with type-constrained segments like {id:int}, {sku:uuid}, and {filepath:path}. Each segment is compiled into a regex once at registration time, so invalid input (e.g. text against {id:int}) simply fails to match rather than reaching the handler — and unknown type names raise immediately at startup instead of silently 404ing in production.
Kribton implements the ASGI interface directly — no framework-on-a-framework. The Request object handles JSON body parsing and decoded headers, while Response automatically serializes dicts, lists, strings, and bytes with the correct content type, so handlers stay focused on logic instead of protocol plumbing.
Every model gets a lazily-resolved .objects manager backed by SQLAlchemy's async engine. It supports .all(), .filter(**kwargs), .get(**kwargs), .create(**kwargs), .update(pk, **kwargs), and .delete(pk) — covering full CRUD without writing raw session code for the common cases, while still allowing a direct SQLAlchemy session for anything more complex.
AsyncDatabase wraps SQLAlchemy's async engine and session factory with sensible pooling defaults (pool size, overflow, recycle, pre-ping) baked in. Registering a database automatically wires it up as the backend for every model, and session() provides commit/rollback/close handling via a single async context manager.