Package: cataloguer
Media cataloguerOrganize 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.DisclaimerPer design, this command line interface toolonly deletes duplicate filesto avoid any risk of losing data.FeaturesMove, copy, sort or delete duplicates operationsUser-friendly console outputObscure creation date detectionCustom folder structure definitionDuplication detectionDoes not alter existing filesRequirementsPython 3.9 or higherInstallationpip install cataloguerUsage$cataloguer--helpUsage:cataloguer[OPTIONS]COMMAND[ARGS]...Commandlineinterface.All[OPTIONS]canbepassedasenvironmentvariableswiththe"CATALOGUER_"prefix.fileargumentsacceptfilenamesandaspecialvalue"-"toindicatestdinorstdout╭─Options───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│--verbose-vEnablesverbosemode.Disabledbydefault│
│--format-patternTEXTPatterntemplate.e.g.%Y/%m/{file}│
│--unknown-format-patternTEXTPatterntemplatefallbackwhendatecannotgetextracted│
│--interactive/--no-interactiveDisablesconfirmationprompts.Enabledbydefault│
│--helpShowthismessageandexit.│
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─Commands──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│copyCopyfiles.Incaseofduplicateswilltaketheshortestname.│
│create-catalogueCreatesanewcatalogue.│
│delete-catalogueDeletesacatalogue.Nofilesareaffected.│
│delete-duplicatesDeleteduplicates.│
│inspectInspectsapathoracatalogue│
│moveMovefiles.Incaseofduplicateswilltaketheshortestname.│
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯QuickstartWe are going to start creating a new directorymedia:mkdir mediaWe are going to create a new catalogue namedlocal_mediawhich is going to get store on the newly createdmediadirectory.
We specify our format pattern so photos are group byyearand a subgroup ofmonth: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_mediaLater 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 indry-runmode:cataloguer move ~/ local_media --dry-runAfter seeing the output, we decided to just reorganize ourPictures:cataloguer move ~/Pictures/ local_mediaTo get a summary of our catalogue we run:cataloguer inspect local_mediaOptionsformat-patternaccepts the following patternsCommon date codes:%d: Day of the month as number%m: Month as number%Y: Year as number%A: Weekday name%B: Month nameother format codes specifiedhere/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 directoryAdvance usage:unknown-format-patternAccepts the same variables asformat-patternbut 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 aCATALOGUER_prefix. e.g:export CATALOGUER_FORMAT_PATTERN=%Y/%m/{file}CATALOGUER_STORAGE_LOCATIONAccepts any path. That location will store metadata.
By default, it will create a.cataloguesin 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 listVideo support