HTTPX

hx

Installation...

uv add 'https://www.encode.io/hx/releases/hx-0.1-py3-none-any.whl'

Making requests with the client...

>>> import hx

>>> cli = hx.Client()
>>> r = cli.get('https://www.example.com/')
>>> r
<Response [200 OK]>

Serving responses with the server...

>>> import hx

>>> def app(request):
...     content = hx.HTML('<html><body>Β‘Hola, mundo!</body></html>')
...     return hx.Response(200, content=content)

>>> s = hx.Server(app, addr='http://127.0.0.1:8000/')
>>> s.serve()

Motivation

A smart, simple HTTP toolkit.

Package sizes

For comparison...

$ uv add hx
$ uv tree --show-sizes --package hx
hx v0.9.0 (33.5KiB)
└── truststore v0.10.0 (17.8KiB)
$ uv add requests
$ uv tree --show-sizes --package requests
requests v2.33.1 (63.4KiB)
β”œβ”€β”€ certifi v2026.2.25 (150.1KiB)
β”œβ”€β”€ charset-normalizer v3.4.7 (302.4KiB)
β”œβ”€β”€ idna v3.11 (69.3KiB)
└── urllib3 v2.6.3 (128.5KiB)

MIT Licensed. Designed & built with love.

— πŸ’– —