Pounce API Reference

Browse Python API documentation by package.

Packages

Modules

_cli

Command-line interface for pounce.

_compression

Content encoding negotiation and compressor factory. Parses Accept-Encoding headers, selects the best encoding, and...

_errors

Error hierarchy for pounce. All pounce errors inherit from PounceError.

_h2_handler

HTTP/2 connection handler — manages multiplexed streams over a single connection. Extracted from ``worker.py`` to...

_health

Built-in health check endpoint. Responds to GET requests at the configured ``health_check_path`` before the request...

_importer

Application importer — resolves string references to ASGI callables.

_priority

HTTP Priority Signals (RFC 9218). Parses the ``Priority`` header (``u=N, i``) from HTTP/2 requests and provides a...

_proxy

Proxy header validation — extract real client info from trusted reverse proxies. When ``trusted_hosts`` is...

_reload

File watcher for development mode (``--reload``). Polls the application's source directory for changes and signals...

_request_id

Request ID generation and propagation. Each request gets a unique ID for tracing across logs and services. If a...

_runtime

Runtime detection utilities. Detects GIL state and determines the appropriate worker mode for the current Python...

_timing

Timing utilities and Server-Timing header builder. Provides monotonic clock helpers for request-level timing and a...

_types

ASGI type definitions for pounce. Typed definitions for the ASGI 3.0 protocol.

_ws_handler

WebSocket connection handler — HTTP/1.1 upgrade lifecycle. Extracted from ``worker.py`` to keep protocol-specific...

config

Server configuration.

lifecycle

Connection lifecycle events — structured, immutable records. Each event captures a moment in a connection's...

logging

Logging configuration and access log formatting. Configures stdlib logging with pounce-specific formatting.

metrics

Prometheus-compatible metrics collector. Implements the ``LifecycleCollector`` protocol to track standard...

pounce

Pounce — A free-threading-native ASGI server for Python 3.14t. Pounce is a pure-Python ASGI server designed from...

server

Server — orchestrates the full pounce lifecycle. Manages the state machine: CONFIG → DETECT → BIND → LIFESPAN →...

supervisor

Supervisor — spawns, monitors, and restarts workers. The supervisor sits between the ``Server`` and the ``Worker``...

worker

Worker — the heart of pounce's request handling. Runs a single asyncio event loop that accepts connections on a...