Single-file core
The framework lives in night.py with no required runtime dependencies on normal CPython.
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-nightfrom 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.pyKeep the framework simple without rebuilding the same web primitives for every project.
The framework lives in night.py with no required runtime dependencies on normal CPython.
Static routes use direct indexes while common dynamic routes compile into specialized fast paths.
Write either style. Night classifies handlers at registration time and builds route-specific invokers.
JSON, forms, multipart, cookies, sessions, CSRF, streaming, SSE, WebSocket, static files, hooks and middleware.
Validate nested dataclasses, optional values and list[T] request bodies without a heavy validation stack.
TestClient, CLI, named routes, OpenAPI generation, JSON-RPC, extensions and a lightweight SQLite ORM.
Expose Night RPC methods as stateless MCP tools with discovery, tool listing and tool calls.
Bridge Worker Requests into Night and expose RPC methods over Workers RPC / Service Bindings.
Deploy the standard ASGI app directly on Vercel's Python runtime—no adapter layer required.
The docs viewer fetches Markdown live from 22552/all-night through the GitHub API. Links between documentation pages stay on this site.
/docs/ loads docs/README.md. Any /docs/*.md path maps to the same file under the official repository's docs/ directory.
Use a normal ASGI server, deploy to Python serverless platforms, or take Night to Cloudflare Python Workers.
Night is alpha software and moving quickly. Read the docs, try the current PyPI release, or follow development on GitHub.