HTTP/HTTPS downloader with cross-session resume, integrity verification, and HuggingFace support
Project description
downcraft
Generic HTTP/HTTPS downloader with cross-session resume via HTTP Range headers. Survives power loss, process crashes, and days-long gaps between sessions.
Quick start
pip install downcraft
# Download any URL
downcraft url https://example.com/bigfile.iso /tmp/bigfile.iso
# Or a HuggingFace model
downcraft hf Qwen/Qwen2.5-0.5B-Instruct
# Check status
downcraft status https://example.com/bigfile.iso
# List all tracked downloads
downcraft list
How resume works
- Download starts → writes to
file.sgpart - Process crashes or connection drops →
.sgpart+~/.downcraft/state.jsonsurvive - Same URL requested again → detects
.sgpart, sendsRange: bytes=N-to server - Server sends only remaining bytes → appended to
.sgpart - On completion → atomically renames to final filename
Python API
from downcraft import download
# Generic URL
result = download("https://example.com/bigfile.iso", "/tmp/bigfile.iso")
print(result["status"]) # "complete"
# With progress callback
def on_progress(downloaded, total, speed_bps):
pct = int(downloaded / total * 100) if total else 0
print(f"\r{pct}% @ {speed_bps/1e6:.1f} MB/s", end="")
download("https://...", "/tmp/file", on_progress=on_progress)
# HuggingFace model (requires huggingface-hub)
from downcraft import download_hf_model
result = download_hf_model("gpt2")
print(result["cache_dir"]) # path to HF cache
CLI
| Command | Description |
|---|---|
downcraft url <url> <dest> |
Download any file |
downcraft hf <model_id> |
Download HF model |
downcraft status <key> |
Check download status |
downcraft list |
List all tracked |
downcraft verify <key> |
Verify integrity |
Dependencies
- requests (required) — HTTP with Range header support
- huggingface-hub (optional) — only needed for HF model commands
Install with HF support: pip install downcraft[hf]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
downcraft-0.2.0-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file downcraft-0.2.0-py3-none-any.whl.
File metadata
- Download URL: downcraft-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d8652af7b828e5ea6d15474c3ce0872721e5ba31ab01c77f4b20ba9989ead8
|
|
| MD5 |
3f4fe8085d117f0642b8251060fac93c
|
|
| BLAKE2b-256 |
f1b5f92f9289426c16911c64a5555cee978b9b19d1fbe3c2a42fd2eaa08c76c9
|