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.
- Provides both client and server functionality.
- Exceptionally lightweight.
- A consistent, minimal API.
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.
— π —