Skip to main content

Media cataloguer

Organize your media files using your preferred directory structure.

  • Do you have pictures taken from different devices?
  • Do you want control over your file system?
  • Do you wish to unify all your media files and remove duplicates?

If you reply affirmative to any of the previous questions, this tool could be right for you too.

This tool helps you to unify and organise your media files using your own rules. It also deals with duplicates, so you don't have to.

Disclaimer

Per design, this command line interface tool only deletes duplicate files to avoid any risk of losing data.

Features

  • Move, copy, sort or delete duplicates operations
  • User-friendly console output
  • Obscure creation date detection
  • Custom folder structure definition
  • Duplication detection
  • Does not alter existing files

Requirements

  • Python 3.9 or higher

Installation

pip install cataloguer

Usage

$ cataloguer --help
                                                                                                                                                                                                    
 Usage: cataloguer [OPTIONS] COMMAND [ARGS]...                                                                                                                                                             
                                                                                                                                                                                                           
 Command line interface.                                                                                                                                                                                   
 All [OPTIONS] can be passed as environment variables with the "CATALOGUER_" prefix.                                                                                                                       
 file arguments accept file names and a special value "-" to indicate stdin or stdout                                                                                                                      
                                                                                                                                                                                                           
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --verbose                       -v        Enables verbose mode. Disabled by default                                                                                                                     │
│ --format-pattern                    TEXT  Pattern template. e.g. %Y/%m/{file}                                                                                                                           │
│ --unknown-format-pattern            TEXT  Pattern template fallback when date cannot get extracted                                                                                                      │
│ --interactive/--no-interactive            Disables confirmation prompts. Enabled by default                                                                                                             │
│ --help                                    Show this message and exit.                                                                                                                                   │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ copy                                          Copy files. In case of duplicates will take the shortest name.                                                                                            │
│ create-catalogue                              Creates a new catalogue.                                                                                                                                  │
│ delete-catalogue                              Deletes a catalogue. No files are affected.                                                                                                               │
│ delete-duplicates                             Delete duplicates.                                                                                                                                        │
│ inspect                                       Inspects a path or a catalogue                                                                                                                            │
│ move                                          Move files. In case of duplicates will take the shortest name.                                                                                            │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Quickstart

We are going to start creating a new directory media:

mkdir media

We are going to create a new catalogue named local_media which is going to get store on the newly created media directory. We specify our format pattern so photos are group by year and a subgroup of month:

cataloguer create-catalogue local_media ./media --format-pattern %Y/%m/{file}

Now, we add some photos from an old storage drive:

cataloguer copy /mnt/hdd/old_photos local_media

Later on, we decided we want to reorganize our local home folder, but we are not sure of how many files are going to be affected, so we run the command in dry-run mode:

cataloguer move ~/ local_media --dry-run

After seeing the output, we decided to just reorganize our Pictures:

cataloguer move ~/Pictures/ local_media

To get a summary of our catalogue we run:

cataloguer inspect local_media

Options

format-pattern accepts the following patterns

  • Common date codes:
    • %d: Day of the month as number
    • %m: Month as number
    • %Y: Year as number
    • %A: Weekday name
    • %B: Month name
    • other format codes specified here
  • / Specifies a new folder
  • {media_type}: Detected file type (image, video)
  • {media_format}: Detected file format (jpeg, tiff, png, gif, mp4 ...)
  • {file} Original filename (photo.jpg)
  • {file_name} Filename without the extension (photo)
  • {file_extension} Filename extension (jpg)
  • {relative_path} Relative path to the source directory

Advance usage:

unknown-format-pattern Accepts the same variables as format-pattern but date patterns are resolved using the current date since it was not possible to recover the creation date of the file. This can be useful to not leave files behind.

Variables can also be specified as environment variables, using a CATALOGUER_ prefix. e.g:

export CATALOGUER_FORMAT_PATTERN=%Y/%m/{file}

CATALOGUER_STORAGE_LOCATION Accepts any path. That location will store metadata. By default, it will create a .catalogues in the user's home directory.

Examples:

Pattern to fix file extensions keeping the folder structure:

 cataloguer --format-pattern {relative_path}/{file_name}.{media_format} sort ./target/

TODO list

  • Video support

Metadata

Release files for cataloguer 2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cataloguer 2.2
File Size Uploaded
cataloguer-2.2.tar.gz 18.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cataloguer 2.2
File Interpreter ABI Platform
cataloguer-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 39.4 kB

Release files / cataloguer-2.2.tar.gz

Download URL cataloguer-2.2.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8e20b535848033889c347c6e53829b80eac447f576159d1e0649b090aa150980
BLAKE2b-256 checksum
How to use checksums
cb0fb03fd3675a4ab71427c0b64948669031317c977bb99b814057b67995d50c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.8.10 Linux/5.15.0-87-generic

Release files / cataloguer-2.2-py3-none-any.whl

Download URL cataloguer-2.2-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dda7d1e9d6590091b386025851bd124b51ff06bfa386cfd31532fc5354c0d533
BLAKE2b-256 checksum
How to use checksums
4471765686c8a0bb3d4961b4eb40bea5c1c8cfbffcfaa969c34610e3a15cb3a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.8.10 Linux/5.15.0-87-generic

Release history Release notifications | RSS feed

This release

2.2 This release

2 release files

2.1

2 release files

2.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page