Skip to content

hayate

Web-standards-first Python web framework, inspired by Hono.

hayate (疾風, swift wind) brings the Fetch API model to Python. Everything you touch maps 1:1 to WHATWG / IETF web standards; Python-local protocols such as WSGI and ASGI are demoted to adapter-level details.

from hayate import Hayate, HTTPException

app = Hayate()

@app.get("/books/:id")
async def show_book(c):
    book = BOOKS.get(c.req.param("id"))
    if book is None:
        raise HTTPException(404, title="Book not found")
    return c.json(book)

Why hayate

  • Standards-firstRequest / Response / Headers / URL follow WHATWG Fetch and URL semantics. Routing syntax is the WHATWG URLPattern standard (/books/:id), not a custom DSL. Errors are RFC 9457 application/problem+json. Learn MDN, and you know hayate.
  • Minimal, portable core — one pure-Python Unicode standards dependency. It runs anywhere CPython runs, including Pyodide (try it in the playground — the framework runs in your browser).
  • One app, three runtimes — the core is a pure fetch(Request) -> Response function. ASGI servers, Cloudflare Python Workers, and AWS Lambda are thin adapters. See Runtimes.
  • Measured, not claimed — standards conformance runs against vendored web-platform-tests with ratcheted pass counts (Conformance); framework overhead is benchmarked at or below Starlette's (Benchmarks).
  • Serverless testingawait app.request("/path") calls the app directly. No server, no test client, milliseconds per test. See Testing.

Install

uv add hayate        # or: pip install hayate

Requires Python 3.12+. Optional native accelerator: pip install hayate-accel.

Run it

uvicorn main:app

Any ASGI server works (uvicorn, hypercorn, granian). The same app deploys to Cloudflare Workers with to_workers(app) and to AWS Lambda with to_lambda(app) — see Runtimes.

Where next