Skip to main content

🗺️ Mapillary Downloader

Download your Mapillary data before it's gone.

▶️ Installation

Installation is optional, you can prefix the command with uvx or pipx to download and run it. Or if you're oldskool you can do:

pip install mapillary-downloader

❓ Usage

First, get your Mapillary API access token from the developer dashboard

# Set token via environment variable (recommended)
export MAPILLARY_TOKEN=YOUR_TOKEN
mapillary-downloader USERNAME1 USERNAME2 USERNAME3

# Or pass token directly, and have it in your shell history 💩👀
mapillary-downloader --token YOUR_TOKEN USERNAME1 USERNAME2

# Download to specific directory
mapillary-downloader --output ./downloads USERNAME1
option because default
usernames One or more Mapillary usernames (required)
--token Mapillary API token (or env var) $MAPILLARY_TOKEN
--output Output directory ./mapillary_data
--quality 256, 1024, 2048 or original original
--bbox west,south,east,north None
--no-webp Don't convert to WebP False
--max-workers Maximum number of parallel download workers CPU count
--max-size Approximate output batch size, or none 900GB
--min-free-space Stop before disk fills, or none 50GB
--max-images Approximate output batch image count None
--no-tar Don't tar bucket directories False
--no-check-ia Don't check if exists on Internet Archive False
--debug Enable verbose downloader logging False
--stats Show archive.org collection statistics False
--clean-up Remove cache dirs containing only log files False

The downloader will:

  • 🏛️ Check Internet Archive to avoid duplicate downloads
  • 📷 Download multiple users' images organized by sequence
  • 📜 Inject EXIF metadata (GPS coordinates, camera info, timestamps, compass direction) and XMP data for panoramas.
  • 🗜️ Convert to WebP (by default) to save ~70% disk space
  • 🛟 Save progress every 5 minutes so you can safely resume if interrupted
  • 📦 Tar sequence directories (by default) for faster uploads to Internet Archive

🖼️ WebP Conversion

You'll need the cwebp binary installed:

# Debian/Ubuntu
sudo apt install webp

# macOS
brew install webp

To disable WebP conversion and keep original JPEGs, use --no-webp:

📦 Tarballs

Images are organized by capture date (YYYY-MM-DD) for incremental archiving:

mapillary-username-quality/
  2024-01-15/
    abc123/
      image1.webp
      image2.webp
    bcd456/
      image3.webp
  2024-01-16/
    def789/
      image4.webp

By default, these date directories are automatically tarred after download (2024-01-15.tar, 2024-01-16.tar, etc.). Reasons:

  • ⤴️ Incremental uploads. Add more to a collection. Well, eventually anyway. This won't work yet unless you delete the jsonl file and start again.
  • 📂 Fewer files - ~365 days/year × 10 years = 3,650 tars max. IA only want 5k items per collection
  • 🧨 Avoids blowing up IA's derive workers. We don't want Brewster's computers to create thumbs for 2 billion images.
  • 💾 I like to have a few inodes available for things other than this. I'm sure you do too.

To keep individual files instead of creating tars, use the --no-tar flag.

🧱 Batch limits

By default the downloader finalizes output in roughly 900GB batches:

mapillary-username-1024-webp/
mapillary-username-1024-webp-2/
mapillary-username-1024-webp-3/

The master resume state stays in the cache directory until the user download is complete, so finalized batches can be uploaded or moved away before rerunning. Chunks are resume-safe output batches, not chronological partitions.

Use --max-size none to restore the old unbounded single-collection behavior. --min-free-space is an emergency guard: if free space falls below the limit, the downloader stops without finalizing the current payload.

🏛️ Internet Archive upload

I've written a bash tool to rip media then tag, queue, and upload to The Internet Archive. The metadata is in the same format. If you symlink your ./mapillary_data dir to rip's 4.ship dir, they'll be queued for upload.

See inlay for details:

📊 Stats

To see overall project progress, or an estimate, use --stats

🚧 Development

make dev      # Setup dev environment
make test     # Run tests. Note: requires `exiftool`
make dist     # Build the distribution
make help     # See other make options

⚖️ License

WTFPL with one additional clause

  1. Don't blame me

Do wtf you want, but don't blame me if it makes jokes about the size of your disk.

Metadata

Release files for mapillary-downloader 0.13.3

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

Source distribution (sdist)

Source distribution for mapillary-downloader 0.13.3
File Size Uploaded Provenance Actions
mapillary_downloader-0.13.3.tar.gz 38.1 kB Without provenance Details for mapillary_downloader-0.13.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mapillary-downloader 0.13.3
File Interpreter ABI Platform Actions
mapillary_downloader-0.13.3-py3-none-any.whl Python 3 none any Details for mapillary_downloader-0.13.3-py3-none-any.whl

Total release size: 84.1 kB

Release files / mapillary_downloader-0.13.3.tar.gz

Download URL mapillary_downloader-0.13.3.tar.gz
Size 38.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fc35d2e16b22b11b0f365f459e63f28be943835a2b78dcaabd43e5e6b95075d5
BLAKE2b-256 checksum
How to use checksums
6c8b8620da8278ac4f0e686cee40799919ae393e254b944668c70cdb3813a271
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mapillary_downloader-0.13.3-py3-none-any.whl

Download URL mapillary_downloader-0.13.3-py3-none-any.whl
Size 46.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50a559f22d500ba4131c282ef07e16da1aebe3a3cb5b2d8c426681f8f53789e5
BLAKE2b-256 checksum
How to use checksums
79bb66735dbeb2da4eb67c9edac93901b6d8b08850375b0ec55a68137a0099c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for mapillary-downloader 0.13.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.13.3 This release

2 release files 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