skillfed

hpack

Pure-Python HPACK header encoding

hpack Permissive license MIT Active 80 v4.2.0 released

Install

hpack on PyPI

pip

pip install hpack

uv

uv add hpack

poetry

poetry add hpack

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 — 51 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: hpack-4.2.0-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 hpack

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

======================================== hpack: HTTP/2 Header Encoding for Python ========================================

.. image:: https://github.com/python-hyper/hpack/workflows/CI/badge.svg :target: https://github.com/python-hyper/hpack/actions :alt: Build Status .. image:: https://codecov.io/gh/python-hyper/hpack/branch/master/graph/badge.svg :target: https://codecov.io/gh/python-hyper/hpack :alt: Code Coverage .. image:: https://readthedocs.org/projects/hpack/badge/?version=latest :target: https://hpack.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 module contains a pure-Python HTTP/2 header encoding (HPACK) logic for use in Python programs that implement HTTP/2.

Documentation

Documentation is available at https://hpack.readthedocs.io .

Quickstart:

.. code-block:: python

from hpack import Encoder, Decoder

headers = [
    (':method', 'GET'),...

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

hpack provides pure-Python HTTP/2 header encoding and decoding using the HPACK compression algorithm, enabling Python programs to implement HTTP/2 protocol support.

Installation is straightforward with no runtime dependencies and a pure-Python wheel distribution. The package is actively maintained with a recent release (51 days old) and an active repository.

hpack is released under the MIT License, a permissive license that allows use in both open-source and proprietary projects with minimal restrictions.

Usage

from hpack import Encoder, Decoder

headers = [(':method', 'GET'), (':path', '/'), ('X-Header', 'value')]
e = Encoder()
encoded = e.encode(headers)
d = Decoder()
decoded = d.decode(encoded)

Requires Python 3.10 or later.

Verdict: hpack is a stable, actively maintained library for HTTP/2 header compression with zero dependencies, permissive licensing, and broad Python 3.10+ support. No known vulnerabilities and top-1000 popularity make it a reliable choice for HTTP/2 implementations.

HTTP/2 header encodingHPACK compressionHTTP/2 protocol implementationheader compression PythonHTTP/2 decoder encoderHPACK pure PythonHTTP/2 header serialization

Similar packages