Skip to main content

hayate

A 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 implementation details.

  • Standards-firstRequest / Response / Headers / URL follow WHATWG Fetch and URL semantics. Routing syntax is the WHATWG URLPattern standard (/books/:id), not a custom DSL.
  • Minimal, portable core — one pure-Python Unicode standards dependency; runs anywhere CPython or Pyodide runs.
  • Runtime-agnostic — the app core is a pure fetch(Request) -> Response function. ASGI servers, Cloudflare Python Workers, and AWS Lambda are thin adapters.
  • Async-first, typed — Python 3.12+.

Install

uv add hayate        # or: pip install hayate

Quickstart

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)

Run with any ASGI server:

uvicorn main:app

Testing without a server

The app core performs no I/O, so tests call it directly — no test client, no sockets:

async def test_show_book():
    res = await app.request("/books/1")
    assert res.status == 200
    assert (await res.json())["id"] == "1"

Runtime-bound CORS allowlists can inspect the request context:

from hayate.middleware import cors

app = Hayate(env={"CORS_ORIGINS": {"https://app.example.com"}})

def allowed_origin(c, request_origin):
    return request_origin if request_origin in c.env["CORS_ORIGINS"] else None

app.use(cors(origin_resolver=allowed_origin, credentials=True))

Conformance and performance, measured

  • Standards conformance runs against vendored web-platform-tests vectors on every pytest run, with ratcheted pass counts — see docs/conformance.md.
  • A locked, end-to-end benchmark measures the same workload against FastAPI, Django, and Hono across startup, dependencies, deployment payload, cold start, throughput, and an HTTP contract. Framework-only ASGI overhead is also benchmarked against Starlette — see docs/benchmarks.md.
  • Every core change is tested against the public auth, fetch, MCP, OpenAPI, and generated Workers heads using the exact unpublished wheel — see docs/ecosystem-compatibility.md.

Status

Alpha (0.11.x): the surface tracks DESIGN.md (Japanese) and may still move before 1.0. Changes are recorded in CHANGELOG.md; platform research lives in docs/research/.

The wider ecosystem adds authentication, MCP, OpenAPI, and a portable client-side fetch. See the hayatepy organization profile for the current compatibility matrix.

License

MIT

Download files

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

Source Distribution

hayate-0.11.1.tar.gz (55.8 kB view details)

Uploaded Source

Built Distribution

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

hayate-0.11.1-py3-none-any.whl (71.9 kB view details)

Uploaded Python 3

File details

Details for the file hayate-0.11.1.tar.gz.

File metadata

  • Download URL: hayate-0.11.1.tar.gz
  • Upload date:
  • Size: 55.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hayate-0.11.1.tar.gz
Algorithm Hash digest
SHA256 ddf3fc49601ce1d15aa5e9534ed5b0d3b526edd33c754a9fb9383344ab992f63
MD5 e44d4ef1664e715bfbeab3200acf14ef
BLAKE2b-256 cf32d27e2c5b507b3cfee503ef9c8d2d6533dda3e422725ef892b3fa990f6adc

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate-0.11.1.tar.gz:

Publisher: release.yml on hayatepy/hayate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hayate-0.11.1-py3-none-any.whl.

File metadata

  • Download URL: hayate-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 71.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hayate-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d10b8f9e61dd095a95c2e3e7f8dc984ecba50a632ed9f6d6375aa4e851759644
MD5 95d5f08230de855b5cce8e55c02ba2cf
BLAKE2b-256 e7e076cdce05ba293165471ac94a5fa8c652df7ae9c925cbf57ed57e4f94236b

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate-0.11.1-py3-none-any.whl:

Publisher: release.yml on hayatepy/hayate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.16.0

2 files

0.15.3

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.2

2 files

This release

0.11.1 This release

2 files

0.11.0

2 files

0.10.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page