Skip to main content
https://raw.github.com/Lukasa/hyper/development/docs/source/images/hyper.png https://travis-ci.org/python-hyper/hyper-h2.png?branch=master

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:

import h2.connection

conn = h2.connection.H2Connection()
conn.send_headers(stream_id=stream_id, headers=headers)
conn.send_data(stream_id, data)
socket.sendall(conn.data_to_send())
events = conn.receive_data(socket_data)

This repository does not provide a parsing layer, a network layer, or any rules about concurrency. Instead, it’s a purely in-memory solution, defined in terms of data actions and HTTP/2 frames. This is one building block of a full Python HTTP implementation.

To install it, just run:

pip install h2

Documentation

Documentation is available at http://python-hyper.org/h2/.

Contributing

hyper-h2 welcomes contributions from anyone! Unlike many other projects we are happy to accept cosmetic contributions and small contributions, in addition to large feature requests and changes.

Before you contribute (either by opening an issue or filing a pull request), please read the contribution guidelines.

License

hyper-h2 is made available under the MIT License. For more details, see the LICENSE file in the repository.

Authors

hyper-h2 is maintained by Cory Benfield, with contributions from others. For more details about the contributors, please see CONTRIBUTORS.rst.

Release History

1.1.0 (2015-10-28)

API Changes (Backward-Compatible)

  • Added a new ConnectionTerminated event, which fires when GOAWAY frames are received.

  • Added a subclass of NoSuchStreamError, called StreamClosedError, that fires when actions are taken on a stream that is closed and has had its state flushed from the system.

  • Added StreamIDTooLowError, raised when the user or the remote peer attempts to create a stream with an ID lower than one previously used in the dialog. Inherits from ValueError for backward-compatibility reasons.

Bugfixes

  • Do not throw ProtocolError when attempting to send multiple GOAWAY frames on one connection.

  • We no longer forcefully change the decoder table size when settings changes are ACKed, instead waiting for remote acknowledgement of the change.

  • Improve the performance of checking whether a stream is open.

  • We now attempt to lazily garbage collect closed streams, to avoid having the state hang around indefinitely, leaking memory.

  • Avoid further per-stream allocations, leading to substantial performance improvements when many short-lived streams are used.

1.0.0 (2015-10-15)

  • First production release!

Metadata

Release files for h2 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h2 1.1.0
File Size Uploaded
h2-1.1.0.tar.gz 33.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for h2 1.1.0
File Interpreter ABI Platform
h2-1.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 58.9 kB

Release files / h2-1.1.0.tar.gz

Download URL h2-1.1.0.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
139ec49cb10c315dd8cb10cc4440f9262367f6cccc82f3b7985928515caa7a84
BLAKE2b-256 checksum
How to use checksums
24e757d0d511c491e74d7f7fafaf217db35cb623dd2c1d9f62d9d0776fb388f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / h2-1.1.0-py2.py3-none-any.whl

Download URL h2-1.1.0-py2.py3-none-any.whl
Size 25.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8b9d505c95102f85ef306d63b4556abc065fc2e72decf6a3b36ff5070dcd6f37
BLAKE2b-256 checksum
How to use checksums
0de2533c6f1638d81c0630aff854b1a0c5744cb52b3ff510bbcdd95eb61896bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

4.4.1

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.4

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page