Skip to main content

Web-standards-first Python web framework: Fetch API semantics, zero dependencies, runtime-agnostic core

Project description

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.
  • Zero dependencies — standard library only. 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"

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.
  • Framework overhead is benchmarked against Starlette (1.2x on simple routes, 1.9x at 64 routes; optional Rust accelerator included) — see docs/benchmarks.md.

Status

Alpha (0.8.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

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

hayate-0.8.1.tar.gz (47.5 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.8.1-py3-none-any.whl (63.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hayate-0.8.1.tar.gz
Algorithm Hash digest
SHA256 4d4c4003d3e3f06d4612df620b595349e6f574dada469ed687f60920ce80dc48
MD5 253023091b694bb654c9c7abac31fe74
BLAKE2b-256 cc095fbcbba93371eefafb94ab834d11ac83ea9e89dfdcb3122e8c6e717e3c1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate-0.8.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.8.1-py3-none-any.whl.

File metadata

  • Download URL: hayate-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 63.3 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.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e254c70b72578dfaa687af3ae7305c8aed5253f6fcc8c400ca7f1c9b7b84b073
MD5 70ee514d48db9f72884ccdec2eb0f76f
BLAKE2b-256 35ebc4a22110681358a78b3b88eaea35b617a921e9f92c72d249c3406dd174d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayate-0.8.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.

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