httplite
Lightweight async HTTP client with automatic retry on transient errors. Built on httpx and tenacity.
Installation
pip install httplite
Quick start
import asyncio
from httplite import send_request
async def main():
# Simple GET
resp = await send_request("GET", "https://httpbin.org/get")
print(resp.status_code)
print(resp.json())
# POST with JSON body
resp = await send_request("POST", "https://httpbin.org/post", json={"key": "value"})
print(resp.json())
# Custom timeout (seconds)
resp = await send_request("GET", "https://httpbin.org/delay/2", timeout=10)
asyncio.run(main())
Features
- Async-first – uses
httpx.AsyncClientunder the hood. - Automatic retry – retries up to 3 times with exponential backoff on transient connection errors (
httpx.RequestError). HTTP error status codes (4xx, 5xx) are not retried. - Configurable timeout – defaults to 30 seconds; override per request.
- Minimal API – a single
send_request()function. Any extra keyword arguments are forwarded directly tohttpx.AsyncClient.request.
API
send_request(method, url, *, timeout=30.0, **kwargs)
| Parameter | Type | Description |
|---|---|---|
method |
str |
HTTP method (GET, POST, PUT, DELETE, etc.) |
url |
str |
Target URL (must use http or https scheme) |
timeout |
float |
Request timeout in seconds (default 30.0) |
**kwargs |
Forwarded to httpx.AsyncClient.request (e.g. json, headers, params) |
Returns: httpx.Response
Raises: ValueError if the URL scheme is not http or https.
Running tests
pip install -e ".[test]"
pytest
License
MIT
Metadata
Release files for httplite 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| httplite-1.1.0.tar.gz | 5.8 kB | With provenance | Details for httplite-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| httplite-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for httplite-1.1.0-py3-none-any.whl |
Total release size: 10.1 kB
Release files / httplite-1.1.0.tar.gz
| Download URL | httplite-1.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d2ca7edd301c5d15cc845cb2cbbcfd24e61da07d48aa509841502af8f85449b
|
|
BLAKE2b-256 checksum How to use checksums |
438c5d7b75feefee63431ae746430dd136e69982e36795e1fc79d8853cef82d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / httplite-1.1.0-py3-none-any.whl
| Download URL | httplite-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
823c7b9ef896b82348280b44d0f68b54ff7cba74209c4c2a55446941e841d431
|
|
BLAKE2b-256 checksum How to use checksums |
549122ef053bd499aeef726e4eca9d5b925eadddfc5e50b94bb018b00f49bcec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logSecurity for httplite 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for httplite-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.