h11

A pure-Python, bring-your-own-I/O implementation of the HTTP/1.1 protocol.

Library
PyPI
v0.16.0
565stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
39/100Needs Attention
Development Activity0
Maintenance0
Community76
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture84
Code Quality85
Innovation78
Learning Curve60

h11 implements the HTTP/1.1 protocol as a pure state machine with no I/O of its own: callers feed it bytes read from a socket and feed it events to send, and h11 tells them what bytes to write and what HTTP events (request lines, headers, body chunks) occurred. This “sans-I/O” design means h11 works identically whether it’s driven by blocking sockets, asyncio, Trio, or any other concurrency model.

Because it owns only protocol parsing and serialization — not networking, TLS, or connection pooling — h11 has become the HTTP/1.1 engine underneath several popular Python HTTP libraries and servers, including httpx, urllib3 (optionally), and the uvicorn/hypercorn ASGI server ecosystem, letting each of them bring their own I/O and concurrency strategy on top of the same well-tested protocol implementation.

What You Get

  • A Connection object that tracks HTTP/1.1 connection state and exposes next_event()/send() for parsing and generating protocol traffic
  • Explicit event types (Request, Response, Data, EndOfMessage, ConnectionClosed) representing every stage of an HTTP/1.1 exchange
  • Correct handling of protocol edge cases: chunked transfer encoding, Connection: close, keep-alive, and pipelining
  • Full decoupling from any specific I/O model, so it can be driven by blocking sockets, asyncio, Trio, or Curio identically
  • A fuzz-tested, specification-focused implementation validated against a corpus of malformed/adversarial HTTP input

Common Use Cases

  • Implementing an HTTP client or server library that wants to bring its own I/O/concurrency model instead of inheriting one
  • Powering the HTTP/1.1 layer of an ASGI server (e.g. Uvicorn, Hypercorn) or async HTTP client (e.g. httpx)
  • Building protocol-level tooling (proxies, testing harnesses, protocol analyzers) that needs precise control over HTTP/1.1 parsing without a full networking stack
  • Writing tests that exercise HTTP/1.1 edge cases (chunked encoding, malformed headers) without needing a live socket

Under The Hood

Architecture h11’s core is _connection.py, which implements a Connection class as an explicit state machine (_state.py defines the state transitions) tracking whether the connection is a client or server, and its current phase (idle, sending headers, sending body, done, etc). _events.py defines the public event types that next_event() returns and that callers pass to send(); _readers.py/_writers.py implement the actual byte-level parsing and serialization for each state, and _receivebuffer.py manages incrementally buffering partial reads. _abnf.py encodes the HTTP grammar rules from RFC 9110/9112 used to validate headers and request/status lines.

Tech Stack Pure Python with zero runtime dependencies, distributed as a standard setup.py-based sdist/wheel, fully typed (ships py.typed), and continuously fuzz-tested via a dedicated fuzz/ harness against malformed HTTP input.

Code Quality The h11/tests directory (12 files) provides dense coverage of protocol edge cases — chunked encoding, header parsing, connection state transitions, and error handling — reflecting the project’s explicit design goal of being a rigorously correct, specification-driven implementation rather than a convenience wrapper. The sans-I/O architecture itself is a code-quality choice: by refusing to touch sockets, the state machine is fully deterministic and unit-testable without mocking network calls.

API Design The public surface is deliberately small: construct a Connection, call .send(event) to generate bytes for the wire, feed received bytes to .receive_data(), and call .next_event() in a loop to get back parsed events. This event-loop-agnostic API requires callers to write their own I/O glue code, which is more upfront work than a batteries-included HTTP client, but gives library authors full control over concurrency and networking behavior.

Used by 15 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,083

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
62
Repo Health
81
Technical
66
Dependency
Built with
TypeScript91%
Updated 3 days ago
Python
83%
Apache 2.0

knowhere

AI Development · Developer Tools

2,515

Transform messy, unstructured documents into persistent, navigable memory that AI agents can actually use.

View details
83
Repo Health
75
Technical
70
Dependency
Built with
Python83%
HTML16%
Updated today
Python
61%
Apache 2.0

marimo

Developer Tools · Data Engineering

22,393

A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.

View details
90
Repo Health
91
Technical
66
Dependency
Built with
Python61%
TypeScript37%
Updated today
Go
56%
Apache 2.0

OSV.dev

Security

2,888

Google's open-source vulnerability database that maps CVEs to exact package versions across 50+ ecosystems with a public API and data dumps.

View details
90
Repo Health
82
Technical
70
Dependency
Built with
Go56%
Python32%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search