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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file mhtg-0.0.3.tar.gz.

File metadata

  • Download URL: mhtg-0.0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for mhtg-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f6860686690091002e312f8e499fd2992b86a3421b864e96b8ee165f6dceb0b0
MD5 c11dc262301c3152b4154db593b185e6
BLAKE2b-256 1004b810b0d99a06151ea5754b253cbc5698e3a10f8c1c856d69924c9c8f82ef

See more details on using hashes here.

File details

Details for the file mhtg-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: mhtg-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for mhtg-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 03633529afbf3d39e5c58484d250b0d6a0bfd9c8ad85315fb7faebcf921e81e2
MD5 d3347866e6ebb5360e0714ce8fb675ac
BLAKE2b-256 adcecae9c6c662d37284f510a87b8413096b41d97b818a649a23bbdf788ed3c8

See more details on using hashes here.

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