Skip to main content

Move photos and videos into a directory tree structure sorted by date taken

Project description

imagemv

Move photos and videos into a directory tree sorted by date taken.

Use as a Sync and / or Backup Script

Optionally keep the original files in the source directory (copy instead of move). Either keep all of them or only up to a certain age (as defined by a configurable number of days). This is a useful feature if the source directory is synced with a mobile phone or similar device with limited storage.

../DEST/
│
├── 2022/
│   ├── 08/
│   │   ├── 23/
│   │   │   └── IMG_20220823_154532.jpg
│   ├── 09/
│   │   ├── 03/
│   │   │   ├── Screenshot-1.png
│   │   │   └── VID_2022-08-24_08:34:56.mp4
│   │   ├── 04/
│   │   │   ├── Matrix.mov
├── 2023/
│   ├── 01/   

The program will recursively traverse the source directory and sort all image files found based on their metadata. If no date is found, the program will try to parse the date from the filename. Failing that, the file's st-mtime will be used.

Original metadata and filenames are preserved. When an image with the same filename already exists at the destination path, the program will skip the file and continue processing with the next file.

Usage

imagemv

Usage:
  imagemv.py SOURCE DEST [--keep=<days>] [--dry-run]
  imagemv.py SOURCE DEST [--keep-all] [--dry-run]
  imagemv.py (-h | --help)
  imagemv.py (-v | --version)

Options:
  -h --help          Show this screen.
  -v --version       Show version.
  --verbose          Print more information about progress.
  --keep=<days>      Keep original files which are newer than the specified age in <days> [default: 0].
  --keep-all         Keep all original files.
  --dry-run          Simulation mode (no changes will be written to the filesystem).

Example

imagemv --dry-run --keep=365 ~/phone-sync/DCIM/Camera ~/Images

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

imagemv-0.4.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

imagemv-0.4.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file imagemv-0.4.0.tar.gz.

File metadata

  • Download URL: imagemv-0.4.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for imagemv-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a7d5a570656e66f7ecf651ae17c5841ab8f5eadd961d67b065b3fdcc2007d507
MD5 1691e1ed3d70b99bc6d3cfc3e226dd30
BLAKE2b-256 f6c7f1d415a7b984ec1eb4d9ab3384b2f389bc2f6fd0de96677569abdb5edc1d

See more details on using hashes here.

File details

Details for the file imagemv-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: imagemv-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for imagemv-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05dd5c378c755f9fa061a05e6844a0d2af5af89bb81da7221e0c15d1a3e18b73
MD5 4ff2632f56bc32ea316dee8ec45774c9
BLAKE2b-256 b41e6f2e6621104a9be4fc17c5007158cc976261df42e9d56d3b77feb1f31280

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