| 1 |
========================= |
| 2 |
h2: HTTP/2 Protocol Stack |
| 3 |
========================= |
| 4 |
|
| 5 |
.. image:: https://github.com/python-hyper/h2/workflows/CI/badge.svg |
| 6 |
:target: https://github.com/python-hyper/h2/actions |
| 7 |
:alt: Build Status |
| 8 |
.. image:: https://codecov.io/gh/python-hyper/h2/branch/master/graph/badge.svg |
| 9 |
:target: https://codecov.io/gh/python-hyper/h2 |
| 10 |
:alt: Code Coverage |
| 11 |
.. image:: https://readthedocs.org/projects/h2/badge/?version=latest |
| 12 |
:target: https://h2.readthedocs.io/en/latest/ |
| 13 |
:alt: Documentation Status |
| 14 |
.. image:: https://img.shields.io/badge/chat-join_now-brightgreen.svg |
| 15 |
:target: https://gitter.im/python-hyper/community |
| 16 |
:alt: Chat community |
| 17 |
|
| 18 |
.. image:: https://raw.github.com/python-hyper/documentation/master/source/logo/hyper-black-bg-white.png |
| 19 |
|
| 20 |
This repository contains a pure-Python implementation of a HTTP/2 protocol |
| 21 |
stack. It's written from the ground up to be embeddable in whatever program you |
| 22 |
choose to use, ensuring that you can speak HTTP/2 regardless of your |
| 23 |
programming paradigm. |
| 24 |
|
| 25 |
You use it like this: |
| 26 |
|
| 27 |
.. code-block:: python |
| 28 |
|
| 29 |
import h2.connection |
| 30 |
import h2.config |
| 31 |
|
| 32 |
config = h2.config.H2Configuration() |
| 33 |
conn = h2.connection.H2Connection(config=config) |
| 34 |
conn.send_headers(stream_id=stream_id, headers=headers) |
| 35 |
conn.send_data(stream_id, data) |
| 36 |
socket.sendall(conn.data_to_send()) |
| 37 |
events = conn.receive_data(socket_data) |
| 38 |
|
| 39 |
This repository does not provide a parsing layer, a network layer, or any rules |
| 40 |
about concurrency. Instead, it's a purely in-memory solution, defined in terms |
| 41 |
of data actions and HTTP/2 frames. This is one building block of a full Python |
| 42 |
HTTP implementation. |
| 43 |
|
| 44 |
To install it, just run: |
| 45 |
|
| 46 |
.. code-block:: console |
| 47 |
|
| 48 |
$ python -m pip install h2 |
| 49 |
|
| 50 |
Documentation |
| 51 |
============= |
| 52 |
|
| 53 |
Documentation is available at https://h2.readthedocs.io . |
| 54 |
|
| 55 |
Contributing |
| 56 |
============ |
| 57 |
|
| 58 |
``h2`` welcomes contributions from anyone! Unlike many other projects we |
| 59 |
are happy to accept cosmetic contributions and small contributions, in addition |
| 60 |
to large feature requests and changes. |
| 61 |
|
| 62 |
Before you contribute (either by opening an issue or filing a pull request), |
| 63 |
please `read the contribution guidelines`_. |
| 64 |
|
| 65 |
.. _read the contribution guidelines: http://python-hyper.org/en/latest/contributing.html |
| 66 |
|
| 67 |
License |
| 68 |
======= |
| 69 |
|
| 70 |
``h2`` is made available under the MIT License. For more details, see the |
| 71 |
``LICENSE`` file in the repository. |
| 72 |
|
| 73 |
Authors |
| 74 |
======= |
| 75 |
|
| 76 |
``h2`` was authored by Cory Benfield and is maintained |
| 77 |
by the members of `python-hyper <https://github.com/orgs/python-hyper/people>`_. |