Skip to content

Every image. Mach speed. Zero lost.

Machyon is a fast async image downloader for Python. Hand it a list of URLs and it tunes its own speed, retries what can recover, keeps only real images, and tells you exactly what it couldn't get.

Watch the film 1:44

No Python setup? Open Machyon in Google Colab: paste links or upload a CSV, get a ZIP back.

In the Amazon ML Challenge? Here's the one cell to paste.

pip install machyon

Python 3.11 or newer, four dependencies. Prefer the terminal? machyon urls.csv -o images/ does the same job.

import machyon

report = machyon.download("urls.csv", "images/")
print(report)
# 4980 downloaded, 0 already on disk, 20 failed in 12.3s (404.9 img/s,
# 8.10 MB/s) | failures: {'http_404': 14, 'not_image': 6}

What "zero lost" means

Every row in your list ends in exactly one of three states: written as a complete, validated image; skipped because a complete file is already on disk; or recorded in failed_downloads.jsonl with a reason. Nothing disappears in between, including when you press Ctrl+C or the disk fills up. Machyon can't download an image the server no longer has, but it will never leave you guessing which ones those are. Read the full contract, with its boundaries.

Tunes its own speed

Concurrency ramps up while throughput improves and backs off within a second or two when a server pushes back. Adaptive concurrency

Polite to servers

Honours Retry-After: after a 429, nothing new goes to that host until the wait is over, and other hosts keep going. Duplicate URLs are fetched once. Retries and rate limits

Real images only

Every body is checked by its magic bytes, so an HTML error page is never saved as photo.jpg. Image validation

Resume by re-running

Finished files are skipped in seconds; large files continue mid-file with HTTP range requests. Resuming

Any list of URLs

CSV, TSV, TXT, JSON, JSONL, Parquet, pandas or polars DataFrames, or a plain Python iterable. Input sources

Script, terminal or browser

One call from a script or notebook, await inside your async app, the machyon command, or machyon ui in your browser. Choosing an interface

How a row travels

Your listCSV, Parquet, a DataFrame, any iterable
PlanDrop duplicate URLs, build names, skip finished files
FetchAdaptive worker pool; back off and retry what can recover
CheckStatus, then magic bytes: is this really an image?
Writtencomplete, atomic
Skippedalready on disk
Recordedwith a reason

Measured, not promised

Real-world faults · 5,000 images

Machyon586 img/s0 missing, 0 bogus
img2dataset, defaults259 img/s98 missing, 10 bogus
img2dataset, retries=3285 img/s10 bogus

Rate-limited CDN (max 48 in flight) · 3,000 images

Machyon300 img/s0 missing, 0 bogus
img2dataset, defaults2 img/s2,992 missing
img2dataset, retries=30 img/s2,997 missing
Local fault-injecting test CDN, every file checked byte for byte. Missing: rows that could have succeeded but have no file. Bogus: files that aren't the image. Full method and every scenario on the benchmarks page.

On a clean, fast network the network itself is the limit and the tools come closer; at 350 ms latency they tie. All five scenarios, the method, and how to reproduce them.

Meet Opa

Opa is an Opabinia, a real animal that swam in Cambrian seas more than 500 million years ago. It had five eyes and one long arm with a claw at the end. Five eyes to watch everything, one reach to grab exactly what you need.

The story behind the mascot