h2
Pure-Python HTTP/2 protocol implementation
Decision gist · record as of 2026-08-14
Yes. h2 is a mature, actively maintained library (latest release 11 days ago, 1038 GitHub stars) with no known vulnerabilities, low installation friction, and permissive licensing. Install it if you need to add HTTP/2 protocol support to a Python application and are willing to handle networking and concurrency yourself. Avoid it if you need a complete HTTP/2 client or server out of the box.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- You must provide your own socket/network layer and handle frame serialization/deserialization at the boundaries.
- Installation is straightforward with low friction—a pure-wheel distribution with only two runtime dependencies (hyperframe and hpack).
License · maintenance · safety
MIT (permissive) — MIT license is permissive and places no restrictions on use, modification, or distribution in proprietary or open-source contexts.
last release 2026-08-03 (11 days) · last repo commit 2026-08-05 · 1,038 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 174,940,172 downloads/mo, #241 on PyPI
Alternatives
Verify before relying
pip install h2
import h2.connection
import h2.config
config = h2.config.H2Configuration()
conn = h2.connection.H2Connection(config=config)
conn.send_headers(stream_id=1, headers=[(':method', 'GET')])
data_to_send = conn.data_to_send()- Whether the package handles HTTP/2 flow control, stream prioritization, and multiplexing automatically or requires manual management.
- Performance characteristics and memory footprint when handling many concurrent streams.
- Compatibility with specific HTTP/2 server implementations or edge cases in the HTTP/2 spec.
What it is and what it does
h2 is a pure-Python implementation of the HTTP/2 protocol that operates at the frame and connection-state level. It handles the core protocol logic—managing streams, encoding/decoding headers via hpack, and organizing frames via hyperframe—but deliberately omits networking, socket handling, and parsing concerns. This design makes it embeddable into any Python program that needs to speak HTTP/2, whether that's a client library, server, proxy, or custom application.
You use h2 by creating a connection object, calling methods to send headers and data, and feeding it incoming socket data to receive protocol events. The library returns serialized frames ready to send over the wire and emits events when data arrives. It's a building block for HTTP/2 support rather than a complete HTTP client or server—you supply the network I/O and concurrency model that fit your use case.
Use it for
- Implement HTTP/2 support in a custom HTTP client or server library without reimplementing the protocol.
- Add HTTP/2 capability to an async framework or event loop that needs fine-grained control over connection state.
- Build a proxy or gateway that needs to speak HTTP/2 to both clients and upstream servers.
- Embed HTTP/2 protocol handling in a non-HTTP application that wants to use HTTP/2 as a transport layer.
- Test HTTP/2 implementations or generate protocol-compliant frames for debugging and validation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
h2 is a mature, actively maintained library (latest release 11 days ago, 1038 GitHub stars) with no known vulnerabilities, low installation friction, and permissive licensing. Install it if you need to add HTTP/2 protocol support to a Python application and are willing to handle networking and concurrency yourself. Avoid it if you need a complete HTTP/2 client or server out of the box.
Install
h2 on PyPI
Before you install
Installation is straightforward with low friction—a pure-wheel distribution with only two runtime dependencies (hyperframe and hpack). The project is actively maintained with a recent release 11 days ago and a stable commit history.
Requires Python 3.10 or later. You must provide your own socket/network layer and handle frame serialization/deserialization at the boundaries.
License in practice
MIT license is permissive and places no restrictions on use, modification, or distribution in proprietary or open-source contexts.
Quickstart
pip install h2
import h2.connection
import h2.config
config = h2.config.H2Configuration()
conn = h2.connection.H2Connection(config=config)
conn.send_headers(stream_id=1, headers=[(':method', 'GET')])
data_to_send = conn.data_to_send()
Verify before relying
- Whether the package handles HTTP/2 flow control, stream prioritization, and multiplexing automatically or requires manual management.
- Performance characteristics and memory footprint when handling many concurrent streams.
- Compatibility with specific HTTP/2 server implementations or edge cases in the HTTP/2 spec.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packageshyperframehpack |
| Maintenance | Actively maintained 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 174,940,172 / month, #241 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPython |
Evidence: h2-4.4.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “h2 connection management”
- h2h2 is a pure-Python HTTP/2 protocol implementation that handles…
- jh2jh2 is a pure-Python HTTP/2 protocol state machine that handles frame…
- hyperhyper is an HTTP/2 client library for Python that provides a…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also hyperframe · jh2 · priority · hpack · wsproto · hyper · hyper-up · socksio · grpclib