pyhaul
Resumable HTTP downloads for Python. Bring your own client: pyhaul borrows your existing session and handles byte-range negotiation, crash-safe checkpointing, and validation.
Install pyhaul from PyPI — pick the extra matching your
HTTP client:
pip install pyhaul[httpx] # or: niquests, requests, urllib3, aiohttp, wreq
import httpx
from pathlib import Path
from pyhaul import haul, PartialHaulError
dest = Path("big.zip")
with httpx.Client() as client:
for _ in range(10):
try:
result = haul("https://example.com/big.zip", client, dest=dest)
break
except PartialHaulError:
pass # only retryable error; others propagate
print(f"done: {dest.stat().st_size:,} bytes")
What is it?
A small, pure-Python library that makes HTTP downloads resumable.
Call haul() with a URL, your existing HTTP client, and a destination
path. pyhaul handles byte-range negotiation, ETag validation,
crash-safe checkpointing, and atomic file completion. Supports both
sync and async across multiple HTTP client libraries.
Each call to haul() upholds these guarantees:
- One
haul()makes one request. You are responsible for retry loops, but retry just means callhaul()again. - The destination file will not exist until download is complete.
Incomplete data lives in a temporary
.partfile; on completion it is atomically moved into place. - Interrupted downloads resume when possible. Checkpoint state
lives on disk, not in memory. Kill the process, lose the network,
get a 503 — the next
haul()picks up from the last durable byte. - If the remote resource changes, retry will not corrupt. ETag mismatch detection prevents gluing mismatched halves together.
- Your HTTP client is borrowed, not owned.
pyhaulsets per-request headers and returns your session untouched. - Transport errors pass through unwrapped.
httpx.ReadTimeoutstayshttpx.ReadTimeout. You catch the types you already know.
No hard dependency on any HTTP library. Pick one (or several) as extras.
Documentation
Full documentation — Quick start, guides, and API reference.
- Quick Start — install, first download, async usage
- Why pyhaul Exists — silent failure modes in HTTP resume, comparison with curl/wget/aria2c
- Design & Architecture — transport adapters, checkpoint state, download lifecycle
- API Reference —
haul(),haul_async(),HaulState, exceptions - Control File Spec — checkpoint format for implementers
Metadata
Release files for pyhaul 0.7.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 | |
|---|---|---|---|
| pyhaul-0.7.0.tar.gz | 141.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyhaul-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 213.7 kB
Release files / pyhaul-0.7.0.tar.gz
| Download URL | pyhaul-0.7.0.tar.gz |
|---|---|
| Size | 141.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f34d0b7b89abef64f612e60cb72454f96708643f7d0e6be344362e2167f3de5
|
|
BLAKE2b-256 checksum How to use checksums |
5ee9c309a8437f26e5e6ba1dc9c4c777ad0d854d7a9fdc7a0d395b97968704ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 8, 2026.
Transparency logRelease files / pyhaul-0.7.0-py3-none-any.whl
| Download URL | pyhaul-0.7.0-py3-none-any.whl |
|---|---|
| Size | 72.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c221dec9dc9b5996f86da300e2f88ccbc17db8c92e2853f08fc5c2d95d75fe5
|
|
BLAKE2b-256 checksum How to use checksums |
054751831936120aef37284724c1c6aa144afb5e42dacc3a07b0819abbbade84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 8, 2026.
Transparency log