Skip to main content

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

  1. Download starts → writes to file.sgpart
  2. Process crashes or connection drops → .sgpart + ~/.downcraft/state.json survive
  3. Same URL requested again → detects .sgpart, sends Range: bytes=N- to server
  4. Server sends only remaining bytes → appended to .sgpart
  5. 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]

Metadata

Release files for downcraft 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for downcraft 0.2.0
File Interpreter ABI Platform
downcraft-0.2.0-py3-none-any.whl Python 3 none any Details

Release files / downcraft-0.2.0-py3-none-any.whl

Download URL downcraft-0.2.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2d8652af7b828e5ea6d15474c3ce0872721e5ba31ab01c77f4b20ba9989ead8
BLAKE2b-256 checksum
How to use checksums
f1b5f92f9289426c16911c64a5555cee978b9b19d1fbe3c2a42fd2eaa08c76c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for downcraft 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page