hpack
Pure-Python HPACK header encoding
Decision gist · record as of 2026-08-14
Yes. hpack is a stable, actively maintained library with zero known vulnerabilities, low install friction, and permissive licensing. Install it if you are building or integrating HTTP/2 protocol support. It is not needed for typical HTTP client/server applications that delegate HTTP/2 handling to a framework.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction installation with no runtime dependencies.
- Active maintenance as of June 2026, supporting modern Python versions (3.10–3.14).
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute hpack freely provided you include the license notice.
last release 2026-06-23 (52 days) · last repo commit 2026-06-23 · 80 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 179,537,813 downloads/mo, #230 on PyPI
Alternatives
Verify before relying
from hpack import Encoder, Decoder
e = Encoder()
encoded = e.encode([(':method', 'GET'), (':path', '/')])
d = Decoder()
decoded = d.decode(encoded)- Performance characteristics (encoding/decoding speed) relative to alternative HPACK implementations.
- Whether the package is actively used by major HTTP/2 frameworks or if it serves primarily as a reference implementation.
What it is and what it does
hpack is a pure-Python implementation of the HPACK header compression algorithm defined in the HTTP/2 specification. It provides Encoder and Decoder classes that transform HTTP header lists into compressed byte sequences and back, enabling HTTP/2 protocol implementations to reduce header overhead on the wire.
The package has no external runtime dependencies and is designed for use in HTTP/2 client and server implementations. It supports current Python versions (3.10 through 3.14) and has been maintained since 2015. The library is part of the python-hyper ecosystem and is positioned as a building block for HTTP/2 protocol support rather than a standalone HTTP client or server.
Use it for
- Building HTTP/2 protocol implementations that need standards-compliant header compression.
- Testing HTTP/2 header encoding and decoding logic in protocol validators or debugging tools.
- Integrating HPACK support into HTTP/2 frameworks or proxy servers.
- Implementing HTTP/2 clients or servers that handle compressed headers.
- Protocol analysis or education—understanding how HTTP/2 header compression works.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
hpack is a stable, actively maintained library with zero known vulnerabilities, low install friction, and permissive licensing. Install it if you are building or integrating HTTP/2 protocol support. It is not needed for typical HTTP client/server applications that delegate HTTP/2 handling to a framework.
Install
hpack on PyPI
Before you install
Low friction installation with no runtime dependencies. Active maintenance as of June 2026, supporting modern Python versions (3.10–3.14). Repository shows steady engagement with recent commits.
Requires Python 3.10 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute hpack freely provided you include the license notice.
Quickstart
from hpack import Encoder, Decoder
e = Encoder()
encoded = e.encode([(':method', 'GET'), (':path', '/')])
d = Decoder()
decoded = d.decode(encoded)
Verify before relying
- Performance characteristics (encoding/decoding speed) relative to alternative HPACK implementations.
- Whether the package is actively used by major HTTP/2 frameworks or if it serves primarily as a reference implementation.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 52 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 179,537,813 / month, #230 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: hpack-4.2.0-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 › “HTTP/2 header encoding”
- hpackEncodes and decodes HTTP/2 headers using the HPACK compression…
- pylsqpackpylsqpack provides Python Decoder and Encoder objects for reading and…
- simplejpegEncodes and decodes JPEG images directly to and from memory using…
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 · pylsqpack · jh2 · h2 · priority · hyper · hyper-up · py-multibase · msgpack-numpy