v0.1.1 · alpha

Python web apps,
after dark.

Night is a tiny, single-file ASGI framework for Python 3.11+. Dependency-free at the core, fast by design, and packed with the pieces you actually need.

$pip install -U all-night
app.py
from night import Night

app = Night()

@app.get("/")
def index():
    return {"hello": "night"}

@app.get("/users/<int:user_id>")
def user(user_id: int):
    return {"id": user_id}

# night run app.py
Why Night

Small core. Serious toolkit.

Keep the framework simple without rebuilding the same web primitives for every project.

1

Single-file core

The framework lives in night.py with no required runtime dependencies on normal CPython.

Fast routing

Static routes use direct indexes while common dynamic routes compile into specialized fast paths.

±

Sync + async

Write either style. Night classifies handlers at registration time and builds route-specific invokers.

HTTP

Batteries included

JSON, forms, multipart, cookies, sessions, CSRF, streaming, SSE, WebSocket, static files, hooks and middleware.

{ }

Typed validation

Validate nested dataclasses, optional values and list[T] request bodies without a heavy validation stack.

Built-in tooling

TestClient, CLI, named routes, OpenAPI generation, JSON-RPC, extensions and a lightweight SQLite ORM.

MCP

MCP tooling

Expose Night RPC methods as stateless MCP tools with discovery, tool listing and tool calls.

CF

Cloudflare Workers

Bridge Worker Requests into Night and expose RPC methods over Workers RPC / Service Bindings.

Vercel ASGI

Deploy the standard ASGI app directly on Vercel's Python runtime—no adapter layer required.

Documentation

Official docs, without leaving Night.

The docs viewer fetches Markdown live from 22552/all-night through the GitHub API. Links between documentation pages stay on this site.

/docs/getting-started/quickstart.md
GitHub-backed Markdown

/docs/ loads docs/README.md. Any /docs/*.md path maps to the same file under the official repository's docs/ directory.

Stay lightweight

One file when you want simplicity. More tools when you need them.

Night is alpha software and moving quickly. Read the docs, try the current PyPI release, or follow development on GitHub.