Skip to main content

A script to organize photos by creation date into year/month/day folders.

Project description

Photo Organizer

Photo Organizer is a Python script that sorts photos from a source directory into a target directory based on their creation date. The script can organize photos into year, month, and optionally day subfolders. It also supports copying or moving files, recursive directory traversal, and filtering by file extensions.

Features

  • Organize photos into year/month/day folders based on creation date
  • Move or copy files from the source to the target directory
  • Recursively traverse directories
  • Filter files by specified extensions
  • Verbose logging for detailed information

Usage

Prerequisites

  • Python 3.x

Installation

Install the package using pip:

pip install photo-organizer

Running the Script

photo_organizer SOURCE_DIRECTORY TARGET_DIRECTORY [OPTIONS]

Arguments

  • SOURCE_DIRECTORY: The source directory containing the photos
  • TARGET_DIRECTORY: The target directory where the photos will be organized

Options

  • -r, --recursive: Sort photos recursively from the source directory
  • -d, --daily: Organize photos into daily folders (year/month/day)
  • -e, --endings: Specify file endings/extensions to copy (e.g., .jpg .png). If not specified, all files are included
  • -v, --verbose: Enable verbose logging
  • -c, --copy: Copy files instead of moving them

Examples

Move all files from source to target, organizing by year and month:

photo_organizer /path/to/source /path/to/target

Move all files recursively and organize by year/month/day:

photo_organizer /path/to/source /path/to/target -r -d

Copy only .jpg and .png files:

photo_organizer /path/to/source /path/to/target -e .jpg .png -c

Enable verbose logging:

photo_organizer /path/to/source /path/to/target -v

Logging

The script uses Python's logging module to provide detailed information about the operations performed. By default, the logging level is set to INFO. Use the -v or --verbose flag to enable DEBUG level logging for more detailed output.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes. Ensure that your code adheres to the existing coding standards and includes appropriate tests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

photo_organizer-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

photo_organizer-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file photo_organizer-1.0.0.tar.gz.

File metadata

  • Download URL: photo_organizer-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for photo_organizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e0866515e8717f9d8f339e4f54aec7717a2a46e869f33a7ee09c03e030850a5
MD5 018f9774d3b0da52fbc8a814d58a4c49
BLAKE2b-256 7fca2e8567fcb6eb09abc49e55c2bbeb53d921d2b8416b998760284ec8714795

See more details on using hashes here.

File details

Details for the file photo_organizer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for photo_organizer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f52c4be33f2658e7f53189b691589614cabdf7c62984c1c7807ef1349ee373aa
MD5 1cce896688c46eb879b95aaceb0a13ea
BLAKE2b-256 eb54fce68cf56461083127a0ddca3fc868616faff9dd9cb585d6b035c41415d0

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