Skip to main content
                  __                   ._.
  ____  ___  ____/  |_ _______ _____   | |
_/ __ \ \  \/  /\   __\\_  __ \\__  \  | |
\  ___/  >    <  |  |   |  | \/ / __ \_ \|
 \___  >/__/\_ \ |__|   |__|   (____  / __
     \/       \/                    \/  \/

Extra is an toolkit to write HTTP/1.1 web services and applications, with first class support for streaming.

Extra works also well in serverless mode, thanks to its AWS Lambda handler.

Extra is focused on providing primitives for creating web services, implemented to work well both in development and production while providing a great developer experience.

Key Features:

  • Server and client, with full control over requests and responses
  • AWS Lambda/Serverless support
  • Streaming reads and writes, lazy decoding and encoding
  • Embedded asynchronous HTTP/1 development server
  • No dependency, only requires Python stdlib
  • Good baseline performance, competitive with FastAPI (5-10K RPS on average hardware)

Design principles:

  • Declarative: decorators to expose methods as web services
  • Stream-oriented: encourages writing stream processing handlers
  • Service focused: template are left out, but lots of building blocks are available for services.

Highlights:

  • Pre/post conditions for request handlers
  • HTML templating (plays nice with HTMX)
  • CORS support
  • Configurable proxy support
  • Integrated logging
  • Regexp-based tree router
  • Server-Side Include (SSI) support
  • Multi-part HTML (MHTML) support

Extra is the successor of Retro, one of the oldest decorator-based framework for HTTP applications and built on the 15+ years of experience developing and maintaining that toolkit.

Like Retro, Extra is designed as a kit, providing easily composable building blocks that help you build fast, readable and resilient web services.

Similar projects include Quart, Starlette, bareASGI and of course, FastAPI.

Example: Hello, World! Service

Here is helloworld.py:

#!/usr/bin/env uv run --with extra-http
from extra import Service, HTTPRequest, HTTPResponse, on, run

class HelloWorld(Service):
    @on(GET="{any}")
    def helloWorld(self, request: HTTPRequest, any:str) -> HTTPResponse:
        return request.respond(b"Hello, World !", "text/plain")

app = run(HelloWorld())

More examples

  • examples/api.py: JSON API with routing, type conversion, and service lifecycle
  • examples/awslambda.py: AWS Lambda handler integration with streaming support
  • examples/capture.py: Request inspection with catch-all routes and body streaming
  • examples/client.py: HTTP client with connection pooling and keepalive
  • examples/client-gzip.py: HTTP client with GZip decompression
  • examples/client-sse.py: HTTP client consuming Server-Sent Events streams
  • examples/cors.py: CORS headers, pre-flight handling, and cross-origin requests
  • examples/fileserver.py: Static file serving with MIME type detection
  • examples/htmx.py: Interactive web apps with HTMX and server-side rendering
  • examples/middleware.py: Pre/post middleware decorators for request/response processing
  • examples/proxy.py: Reverse proxy with header manipulation and forwarding
  • examples/sse.py: Server-Sent Events streaming with async generators
  • examples/upload.py: File upload handling with HTML forms
  • examples/watch.py: Filesystem change streaming via SSE using CLI watchers
  • examples/workers.py: Background task processing with asyncio queues

Metadata

Release files for extra-http 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extra-http 1.1.2
File Size Uploaded Provenance
extra_http-1.1.2.tar.gz 79.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for extra-http 1.1.2
File Interpreter ABI Platform
extra_http-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 168.1 kB

Release files / extra_http-1.1.2.tar.gz

Download URL extra_http-1.1.2.tar.gz
Size 79.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4f28dfeb18fe5b18a3c749058fdb4e68e13089cf9b8ff337a3227335c9c13f4c
BLAKE2b-256 checksum
How to use checksums
b2ee14d9c8010cdf271bd3b3637a2f928f03739ad2fa0c4444b456632406ac6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / extra_http-1.1.2-py3-none-any.whl

Download URL extra_http-1.1.2-py3-none-any.whl
Size 88.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94d1ddd70542db23fdc384cc6b6d67a7aa07002b42c28e035a394163eaddacbc
BLAKE2b-256 checksum
How to use checksums
abb88acbe5b6376680bfcc13bc06adc9340a3cfb63a85caea1ea2f723e0bce48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for extra-http 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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