causeway (Python)
A lean backend framework for type-safe Python APIs.
uv add causeway
This is the core Python package of Causeway. It ships:
- A file-based router that walks
src/app/routes/**/*.py, picks up$id.py,(group)/,_middleware.py, and_scope.py, and registers handlers into the app's route table. - A typed config layer that wraps
pydantic-settingsand exposes non-secret fields to the generated TypeScript client. - A scoped DI container driven by
_scope.pyproviders. - A
@taskcontract for background jobs with a Dramatiq reference adapter. - A plugin registry with Python-entry-point discovery and per-environment activation.
- A route-key client generator that emits typed TypeScript clients from the same route IR.
- An App Graph that exposes routes, scopes, permissions, middleware, providers, tasks, plugins, events, and refresh contracts.
- A CLI (
causeway new,causeway dev,causeway build,causeway inspect,causeway deploy <target>) that runs the whole loop.
For the full story, the design rationale, and a side-by-side vs. FastAPI / Django + Ninja / Encore.ts / NestJS, see the repo README.
30-second example
my-app/
├── pyproject.toml
├── causeway.toml
└── src/app/
├── config.py
├── plugins.py
└── routes/
├── _middleware.py
├── index.py
└── users/
├── _scope.py
├── index.py
└── $id.py
# src/app/routes/users/$id.py
from typing import Annotated
from uuid import UUID
from msgspec import Struct
from causeway import get, raises
from causeway.errors import NotFound
class User(Struct):
id: UUID
name: str
@get
@raises(NotFound)
async def show(id: UUID) -> User:
...
Run it:
causeway dev
causeway dev discovers the routes, boots uvicorn once, hot-swaps route edits without restarting the process, and exposes /__causeway with the route tree, registered tasks, current config, plugin list, and App Graph.
The public client identity is the route key:
const user = await client.query("GET /users/$id", { id });
Primitives in this package
| Primitive | Purpose |
|---|---|
File router ($id.py, (group)/) |
Discovery + URL pattern generation. |
_middleware.py / _scope.py |
Per-subtree middleware + scoped DI providers. |
Settings (wraps pydantic-settings) |
Typed config with allowlisted exposure to the generated client. |
@get / @post / @put / @patch / @delete |
HTTP method decorators. |
@post(refreshes=...) |
Mutation refresh contract for the route-key client. |
@task(...) |
Background-job contract; adapter-agnostic. |
@cron(...) |
Scheduled tasks via the same adapter. |
register(...) |
Plugin registration (TaskAdapter, Storage, KV, AuthProvider, …). |
causeway inspect |
App Graph inspection. |
TestApp |
Test client with DI overrides and tasks_eager() mode. |
causeway CLI |
new, dev, build, codegen, ir, inspect, openapi, deploy. |
Full reference: https://github.com/tamimbinhakim/causeway/tree/main/docs/reference
Optional extras
uv add 'causeway[dramatiq]' # reference task adapter
uv add 'causeway[otel]' # OpenTelemetry middleware hooks
uv add 'causeway[all]' # everything
Scope
Causeway ships project shape and a small set of contracts. It does not ship vertical integrations — no ORM, no admin panel, no template engine, no infrastructure provisioning. Those layers compose on top of the fundamentals and live in their own plugin packages or in user code.
License
MIT
Metadata
Release files for causeway 0.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| causeway-0.6.4.tar.gz | 186.7 kB | With provenance | Details for causeway-0.6.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| causeway-0.6.4-py3-none-any.whl | Python 3 | none | any | Details for causeway-0.6.4-py3-none-any.whl |
Total release size: 343.7 kB
Release files / causeway-0.6.4.tar.gz
| Download URL | causeway-0.6.4.tar.gz |
|---|---|
| Size | 186.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdfe71b5b3913d6ffe6d237eff8aa60f73f1b2c4c2cd7755a2cc6c68348c79e9
|
|
BLAKE2b-256 checksum How to use checksums |
d63fbc4abbc8ae24adea8bad7c1b327f5ebcd1a410adeb44874e937ec66b1d6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.
Transparency logRelease files / causeway-0.6.4-py3-none-any.whl
| Download URL | causeway-0.6.4-py3-none-any.whl |
|---|---|
| Size | 157.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddabb00c6490523bd53109772dde12782073e67825bde4fff31ed56b2d0fac71
|
|
BLAKE2b-256 checksum How to use checksums |
05e59b298d1607db00f80430539bd04cbd1baea757082e1e7ec397e8abc9f072
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.
Transparency logSecurity for causeway 0.6.4
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for causeway-0.6.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.
Transparency logA 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.