Skip to main content

mhtg

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mhtg-0.0.3.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

mhtg-0.0.3-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page