Skip to main content

Export and sort Apple Photos library metadata by file size

Project description

iphoto-sizer

Exports metadata from your macOS Apple Photos library to CSV or JSON, sorted by file size (largest first). Useful for finding what's eating your iCloud storage.

Includes an optional web UI for browsing, filtering, and exporting results from your browser.

Screenshots

Landing Page Scan Results
Landing page Scan results

Prerequisites

  • macOS with the Photos app and a library present
  • Python 3.11+
  • Full Disk Access granted to your terminal (System Settings > Privacy & Security > Full Disk Access)

Install

From PyPI:

pip install iphoto-sizer

With the optional web UI:

pip install "iphoto-sizer[web]"

Or with uv:

uv tool install iphoto-sizer        # CLI only
uv tool install "iphoto-sizer[web]"   # CLI + web UI

Or from source:

git clone https://github.com/spencerpresley/iPhotoSizer.git && cd iPhotoSizer
uv sync              # CLI only
uv sync --extra web  # CLI + web UI

Usage

If you installed with pip install or uv tool install, the iphoto-sizer command is available globally. If you installed from source with uv sync, prefix commands with uv run (e.g., uv run iphoto-sizer).

CLI

# Export everything to photos_report.csv in the current directory
iphoto-sizer

# Only items larger than 100 MB
iphoto-sizer --min-size-mb 100

# Write to a specific path
iphoto-sizer -o ~/Desktop/large_files.csv

# Export as JSON instead of CSV
iphoto-sizer -f json -o ~/Desktop/photos.json

# Combine options
iphoto-sizer --min-size-mb 500 -f json -o ~/Desktop/big_ones.json

Web UI

iphoto-sizer --web

Opens a local web server in your browser where you can:

  • Run a new scan or open an existing JSON report
  • Browse all items with sorting, filtering, and search
  • View summary stats (total size, item counts, video/photo breakdown)
  • Export results to CSV, JSON, or both
  • Open individual photos directly in Photos.app (experimental)

CLI Options

Flag Description Default
--min-size-mb Only include items at or above this size (MB) 0 (all items)
-o, --output Output file path photos_report.csv
-f, --format Output format: csv or json csv
--web Launch the web UI in a browser off

Output

CSV columns / JSON fields:

filename, extension, media_type, size_bytes, size, creation_date, uuid, icloud_status

  • size is human-readable (e.g. "150.23 MB", "1.50 GB")
  • icloud_status is "local" if the original file is on disk, "cloud-only" if it only exists in iCloud
  • Records are sorted by size_bytes descending

A summary of total items, total size, and the 10 largest files is printed to stderr after export.

Notes

  • Full Disk Access is required because the tool reads the Photos library's SQLite database directly (via osxphotos). Grant it to your terminal app in System Settings > Privacy & Security > Full Disk Access.
  • Initial library load typically takes 5-20 seconds depending on library size.
  • Photos that fail to parse are skipped with a warning; they don't stop the export.
  • The tool checks for at least 50 MB of free disk space before writing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iphoto_sizer-0.1.2.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iphoto_sizer-0.1.2-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file iphoto_sizer-0.1.2.tar.gz.

File metadata

  • Download URL: iphoto_sizer-0.1.2.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for iphoto_sizer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9ff3eff90fc146ada9626cbe01535c74ed79855ed6ec908a5009a342d25783e6
MD5 b2081120b2475f47c09037b2965445d7
BLAKE2b-256 0070ff40b87f99bec8d358a24088bc88b4668a6c18b4b6b81d50e7f75575624b

See more details on using hashes here.

File details

Details for the file iphoto_sizer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: iphoto_sizer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for iphoto_sizer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 648410b7f92664c91d8b15cf31853b8813dc723e8b6e5f6688a5163e46abcd1a
MD5 fee5643d16f8d5c9987593340c862380
BLAKE2b-256 cd713455079e82fd7c5abf67daa9dd0ba683df9e3fd89c2176d9d779837d646f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page