skillfed

h2

Pure-Python HTTP/2 protocol implementation

h2 Permissive license MIT Active 1,038 v4.4.1 released

Install

h2 on PyPI

pip

pip install h2

uv

uv add h2

poetry

poetry add h2

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — hyperframe, hpack
Maintenance actively maintained — 10 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: h2-4.4.1-py3-none-any.whl

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

About h2

from the package's own PyPI description — quoted content, verbatim

========================= h2: HTTP/2 Protocol Stack =========================

.. image:: https://github.com/python-hyper/h2/workflows/CI/badge.svg :target: https://github.com/python-hyper/h2/actions :alt: Build Status .. image:: https://codecov.io/gh/python-hyper/h2/branch/master/graph/badge.svg :target: https://codecov.io/gh/python-hyper/h2 :alt: Code Coverage .. image:: https://readthedocs.org/projects/h2/badge/?version=latest :target: https://h2.readthedocs.io/en/latest/ :alt: Documentation Status .. image:: https://img.shields.io/badge/chat-join_now-brightgreen.svg :target: https://gitter.im/python-hyper/community :alt: Chat community

.. image:: https://raw.github.com/python-hyper/documentation/master/source/logo/hyper-black-bg-white.png

This repository contains a pure-Python implementation of a HTTP/2 protocol stack. It's written from the ground up to be embeddable in whatever program you choose to use, ensuring that you can speak HTTP/2 regardless of your programming paradigm.

You use it like this:

.. code-block:: python

import h2.connection
import h2.config

config = h2.config.H2Configuration()
conn =...

Read as markdown · JSON record · Source repository · Homepage · Docs

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

h2 is a pure-Python HTTP/2 protocol implementation that handles frame-level communication, header encoding, and stream management for embedding HTTP/2 support into any Python application.

Installation is straightforward with low friction: h2 is a pure-Python wheel with only two lightweight runtime dependencies (hyperframe and hpack). The project maintains active development with a release 10 days ago and commits through August 2026, indicating ongoing maintenance.

h2 is released under the MIT License, a permissive license that allows free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Usage

import h2.connection
import h2.config

config = h2.config.H2Configuration()
conn = h2.connection.H2Connection(config=config)
conn.send_headers(stream_id=1, headers=[(b':method', b'GET')])
data = conn.data_to_send()
# Send data over socket, then receive and parse responses

Requires Python 3.10 or later; h2 provides protocol logic only—you must handle socket I/O and concurrency yourself.

Verdict: h2 is a stable, actively maintained HTTP/2 implementation suitable for production use. With no known vulnerabilities, minimal dependencies, and permissive licensing, it's a reliable choice for projects needing HTTP/2 protocol support. The low install friction and broad Python version support (3.10–3.14) make adoption straightforward.

Needs verification

  • Whether h2 is suitable for high-throughput or latency-sensitive applications compared to alternatives
  • Performance characteristics and benchmarks relative to other HTTP/2 implementations
HTTP/2 protocol implementationpure Python HTTP/2HTTP/2 frame handlingh2 connection managementHTTP/2 stream multiplexingembeddable HTTP/2 stackHTTP/2 header compression

Similar packages