Skip to content

Urich

Urich helps teams building Python microservices who want DDD/CQRS without a heavy framework — one consistent style for domain, events, RPC and discovery, like FastAPI with routers.

Compose your app from module objects with app.register(module).


Features

  • One object = one building block — DomainModule, EventBusModule, OutboxModule, DiscoveryModule, RpcModule. Fluent API, attach with app.register(module).
  • DDD out of the box — Bounded context as DomainModule: .aggregate(), .repository(), .command(), .query(), .on_event(). Commands and queries get HTTP routes automatically.
  • No lock-in — Protocols (EventBus, ServiceDiscovery, RpcTransport) in core; implementations (Redis, Consul, HTTP+JSON) by you or optional adapters.
  • OpenAPI / Swaggerapp.openapi(...) adds /openapi.json and /docs.

Install

pip install urich

With CLI for generating app/context/aggregate skeletons:

pip install "urich[cli]"

Quick start

from urich import Application
from orders.module import orders_module

app = Application()
app.register(orders_module)
# Run: uvicorn main:app --reload

Routes by convention: POST /orders/commands/create_order, GET /orders/queries/get_order. Add app.openapi(title="My API", version="0.1.0") — then open /docs for interactive Swagger UI with no extra setup.


Next