porg

Crates.ioporg
lib.rsporg
version0.1.2
sourcesrc
created_at2024-12-11 20:34:36.321247
updated_at2024-12-11 20:41:24.067394
descriptionA command-line tool for renaming, organizing, and backing up photos to local and remote destinations
homepage
repositoryhttps://github.com/joel-hamilton/porg
max_upload_size
id1480511
size60,743
Joel Hamilton (joel-hamilton)

documentation

README

porg

porg (Photo ORGanizer) is a command-line tool for renaming, organizing, and backing up photos to local and remote destinations. It uses EXIF data to rename files and organize them into year/month folders. It supports common photo formats like JPG, CR2, and CR3.

Features

  • Rename: Renames photos based on their EXIF date and time data.
  • Organize: Organizes photos into year/month folder structure.
  • Copy (Local & Remote): Copies photos to local or remote destinations.
  • EXIF Parsing: Parses and displays EXIF data from photos.
  • Configuration: Supports a TOML configuration file for storing default settings.

Installation

cargo install porg

Requirements

  • exiftool: Must be installed on your system. See installation instructions at https://exiftool.org/install.html
  • SSH (for remote copy): Required for copying to remote destinations.
  • rsync (for local/remote copy): Required for copying to local destinations. This should be installed by default on Mac/Linux. For Windows you'll probably need to use WSL or Cygwin.

Usage

porg offers several subcommands:

1. Rename Photos

porg rename --source ~/photo-dump --recursive
  • --source: Path to the directory containing the photos.
  • --recursive: (Optional) Process subdirectories recursively.

2. Organize Photos

porg organize --source ~/photo-dump
  • --source: Path to the directory containing the photos.

3. Copy Photos Locally

porg copy-local --source ~/photo-dump --destination /Volumes/photos
  • --source: Path to the directory containing the photos.
  • --destination: Path to the local destination directory.

4. Copy Photos Remotely

porg copy-remote --source ~/photo-dump --destination user@123.456.789.123:~/photos
  • --source: Path to the directory containing the photos.
  • --destination: Address of the remote server and destination path. Format: user@server:/path/to/destination

5. Parse EXIF Data

porg parse --file /path/to/image.jpg
  • --file: Path to the image file.

Configuration

porg can be configured using a TOML file. By default, it looks for config.toml in the following locations:

  • Current directory
  • $HOME/.config/porg/config.toml

Sample Configuration

supported_extensions = ["jpg", "JPG", "CR2", "CR3"]
date_format = "%Y%m%d_%H%M%S"
source = "/path/to/your/photos"
remote_path = "user@remote-server:/path/to/backup"
local_path = "/path/to/local/backup"
logging_level = "info"

Configuration Options

  • supported_extensions: File extensions to process.
  • date_format: Date format for renaming files (using strftime syntax).
  • source: Default source directory.
  • remote_path: Default remote destination path.
  • local_path: Default local destination path.
  • logging_level: Logging level ("info" or "debug").

Using a Custom Configuration File

porg --config /path/to/your/config.toml <COMMAND> [OPTIONS]

Contributing

Contributions are welcome! Please submit a pull request.

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt