Skip to main content

mhtg: minimal h11/trio glue

features

  • h11, a transport agnostic standards-compliant http/1.1 implementation

  • trio, an async/await-native IO library focused on usability and correctness

usage

contrived example:

from functools import partial
from mhtg import client, context, model
import trio

client_factory = partial(client.client_factory,
                         server_hostname="google.com",
                         port=443)

connection_manager = context.make_connection_manager(client_factory)

def request_builder():
    request = h11.Request(method="GET",
                          target="/",
                          headers=[
                              ("host", server_hostname),
                              ("content-length", 0),
                          ])

    return request,

async def do():
    async with connection_manager() as reuse_connection:
        async with reuse_connection() as make_request:
            await make_request(*request_builder())

trio.run(do)

Metadata

Release files for mhtg 0.0.3

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

Source distribution (sdist)

Source distribution for mhtg 0.0.3
File Size Uploaded
mhtg-0.0.3.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mhtg 0.0.3
File Interpreter ABI Platform
mhtg-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / mhtg-0.0.3.tar.gz

Download URL mhtg-0.0.3.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f6860686690091002e312f8e499fd2992b86a3421b864e96b8ee165f6dceb0b0
BLAKE2b-256 checksum
How to use checksums
1004b810b0d99a06151ea5754b253cbc5698e3a10f8c1c856d69924c9c8f82ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / mhtg-0.0.3-py3-none-any.whl

Download URL mhtg-0.0.3-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03633529afbf3d39e5c58484d250b0d6a0bfd9c8ad85315fb7faebcf921e81e2
BLAKE2b-256 checksum
How to use checksums
adcecae9c6c662d37284f510a87b8413096b41d97b818a649a23bbdf788ed3c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

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