Skip to main content

Import photos and videos from your iPhone to your computer via USB.

Project description

dcimport

PyPI Platform License: MIT

dcimport copies photos and videos from an iPhone (or any iOS device) to a local folder, reading the camera roll (/DCIM) over USB via AFC. It bypasses iCloud and iTunes, installs nothing on the device, and only ever reads from it.

Runs are incremental: a local SQLite database records what was copied, so re-runs fetch only new or changed files. Downloads run in parallel and are committed by atomic rename, so an interrupted run resumes with a plain re-run. Original mtimes are preserved.

Beyond a plain copy: filename/folder layout templates, --since/--until date filtering, HEIC→JPEG conversion, skipping the video half of Live Photos, and a JSON manifest per run.

demo

Install

Requires Python 3.11+.

uv tool install dcimport            # or: pip install dcimport
uv tool install "dcimport[heic]"    # to enable --convert-heic

Usage

dcimport ~/Pictures/iPhone

Connect the iPhone by USB, unlock it, and tap Trust. On Windows, iTunes or the Apple Devices app must be installed for the drivers.

dcimport ~/Pictures --layout "{mtime:%Y}/{mtime:%m}/{name}"   # sort into year/month folders
dcimport ~/Pictures --since 2024-01-01 --convert-heic         # recent photos, converted to JPEG
dcimport ~/Pictures --manifest run.json                       # also write a JSON report

Run dcimport --help for the full list of options.

Layout

--layout is a template of {name} (original filename) and {mtime:...} (capture time, strftime codes), and may contain / for subfolders. The default is {mtime:%Y-%m-%d_%H-%M-%S}_{name}2024-01-02_03-04-05_IMG_0001.JPG. The layout is stored with the library on first use and reused on later runs; changing it requires --force.

How it tracks files

Each copied file is recorded — by on-device path, size, and modification time — in media.db inside the output directory, and skipped on later runs. Editing a photo on the phone changes its mtime, so it re-imports as a new file; deleting media.db re-imports everything. Local files are never overwritten — name clashes get a _1, _2, … suffix.

Development

git clone https://github.com/artificiadrian/dcimport.git
cd dcimport && uv sync --all-extras && uv run pytest

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

dcimport-0.1.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

dcimport-0.1.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file dcimport-0.1.1.tar.gz.

File metadata

  • Download URL: dcimport-0.1.1.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for dcimport-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8525cfbf7d1e3802c1c4187d965f807ac0cb89a442c428ca10d259536002584e
MD5 3cf75a6d6e11065ff221c2e77c544172
BLAKE2b-256 f29b3ef0b453a766052d8367e65c4ccae5236956a38b78a483c5107c44f1c4c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dcimport-0.1.1.tar.gz:

Publisher: publish.yml on artificiadrian/dcimport

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dcimport-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dcimport-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for dcimport-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cad98df8348e68ad4e53145f290af139a7c6b061588458cc77b384385fb827c6
MD5 fab3e6bd87207779894e15da2aead306
BLAKE2b-256 659fbdaf2fa547cc120d6ced8012c9f0b08e64af2167ed39d4438f16e31bb76e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dcimport-0.1.1-py3-none-any.whl:

Publisher: publish.yml on artificiadrian/dcimport

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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