Skip to main content

An opinionated, msgspec-first ASGI micro-framework

Project description

jero

Release Build status codecov Commit activity License

An opinionated, msgspec-first ASGI micro-framework for Python 3.14.

What is jero?

jero is built on three non-negotiable pillars:

  1. Speed. All introspection happens once, at wiring time. The per-request path is just dict lookup → msgspec decode → call → encode — nothing else.
  2. Opinionated, scaffolded DX. There is one blessed way to do each thing. Contracts are checked at startup and fail loud with a precise WiringError, never silently at runtime.
  3. Strict, expressive typing. Everything is fully, statically typed under pyright-strict. Types are the contract — the binding, the wiring errors, and (on the roadmap) the source of the OpenAPI spec.

It deliberately has no DI container: you hand-wire dependencies in _wire, and the framework owns only what the language doesn't give you for free — lifecycle.

Example

from msgspec import Struct

from jero import BaseApp, Endpoint, Resource, TestClient


class Widget(Struct):
    id: str
    name: str


class WidgetResource(Resource):
    async def read_one(self, path: "WidgetPath") -> Widget:
        return Widget(id=path.widget_id, name="widget-name")


class WidgetPath(Struct):
    widget_id: str


class HealthEndpoint(Endpoint):
    async def get(self) -> Widget:
        return Widget(id="health", name="ok")


class App(BaseApp):
    async def _wire(self) -> None:
        self._include_resource(WidgetResource(), path="/widgets")
        self._include_endpoint(HealthEndpoint(), path="/healthz")


app = App()

# Test it in-process — no socket, no server:
with TestClient(app) as client:
    resp = client.get("/widgets/abc")
    assert resp.status_code == 200
    assert resp.json() == {"id": "abc", "name": "widget-name"}

Run it under any ASGI server, e.g. granian:

granian --interface asgi myapp:app

Development

task install   # create the venv and install pre-commit hooks
task check     # lock check + ruff, pyright, deptry, pylint (via prek)
task test      # run the test suite with coverage

See AGENTS.md for the design philosophy and the contract, and style-guide.md for project conventions.

Releasing a new version

Publishing uses PyPI Trusted Publishing (OIDC) — no token required.

  1. Bump version in pyproject.toml and commit it to main.
  2. Create a GitHub release tagged with the same version — a bare PEP 440 string, e.g. 0.1.0 (no v).

The release workflow verifies the tag matches pyproject.toml, builds, publishes to PyPI, and deploys the docs. A version mismatch fails the release.


Repository initiated with osprey-oss/cookiecutter-uv.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jero-0.0.3.tar.gz (101.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jero-0.0.3-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file jero-0.0.3.tar.gz.

File metadata

  • Download URL: jero-0.0.3.tar.gz
  • Upload date:
  • Size: 101.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for jero-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d5cca1a5a44d9fa2bd7ca6c0a065293598e758b161ef300ff2e31f221159891c
MD5 44d55500200f1c1702ceff617d91c888
BLAKE2b-256 cbb40768defe65b6bab1067e3bc54e7ec1643a950bea75b0ad387875e59f3138

See more details on using hashes here.

File details

Details for the file jero-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: jero-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for jero-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 87d4eafc9559a2b2e508cfefd1442da03b97a3d4af201c1ee764d6c19d0cc18c
MD5 3a485d94977501eaaec9c19f9e2a8686
BLAKE2b-256 ecf08e84c59af1203d50134eb2c48e4a31542b4b118aa0c80cdcb3ed3d07950d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page