===== Usage ===== .. code-block:: console Usage: tagrenamer [OPTIONS] [DIRECTORY]/ Options: --version show program's version number and exit -h, --help show this help message and exit -d, --dry-run Perform a dry run and don't touch anything. -f F, --format=F The format in which filenames will be rewritten. -l L, --leftovers=L The directory where non-music files will be moved to. -S S, --stagedir=S Temporary directory before music hits its final spot. -s, --shell Generate and print shell commands (implies -q and -d) -q, --quiet Silence non-debugging output completely. -v, --verbose The level of logging verbosity. ``--version`` ------------- Report the application version: .. code-block:: console $ tagrenamer --version tagrenamer 0.0.3 ``--dry-run`` ------------- Test if the renames will succeed without touching files: .. code-block:: console $ tagrenamer --dry-run Music/ - Tagrenamer version 0.0.3. - Leftovers directory '__LEFTOVERS/' created. - Stage directory '__STAGE/' created. - Traverse the collection and extract music tags. - Validating tag input and sanitizing variables. - Moving non music files to '__LEFTOVERS/'. - Moving music to new tree in stage directory '__STAGE/'. - Remove empty directories (except stage/leftover directories). - Move everything from stage into the final location. - Deleting the temporary stage directory '__STAGE/'. - Deleting the empty leftovers directory '__LEFTOVERS/'. - DONE! Processed 11 files. Combine with ``-vvvvv`` to see how the structure looks like. ``--leftovers`` --------------- Name the leftovers directory differently: .. code-block:: console $ tagrenamer --leftovers='garbage' Music/ - Tagrenamer version 0.0.3. - Leftovers directory 'garbage/' created. - Stage directory '__STAGE/' created. - Traverse the collection and extract music tags. - Validating tag input and sanitizing variables. - Moving non music files to 'garbage/'. - Moving music to new tree in stage directory '__STAGE/'. - Remove empty directories (except stage/leftover directories). - Move everything from stage into the final location. - Deleting the temporary stage directory '__STAGE/'. - Deleting the empty leftovers directory 'garbage/'. - DONE! Processed 36 files. ``--stagedir`` -------------- Name the temporary staging directory differently: .. code-block:: console $ tagrenamer --stagedir='.tmp' Music/ - Tagrenamer version 0.0.3. - Leftovers directory '__LEFTOVERS/' created. - Stage directory '.tmp/' created. - Traverse the collection and extract music tags. - Validating tag input and sanitizing variables. - Moving non music files to '__LEFTOVERS/'. - Moving music to new tree in stage directory '.tmp/'. - Remove empty directories (except stage/leftover directories). - Move everything from stage into the final location. - Deleting the temporary stage directory '.tmp/'. - Deleting the empty leftovers directory '__LEFTOVERS/'. - DONE! Processed 36 files. ``--shell`` ----------- Generate a list of shell commands that you can manually review and paste into your terminal. Enabling ``--shell`` also implies ``--quiet`` and ``--dry-run`` and will never touch your files: .. code-block:: console $ tagrenamer --format='{artist}/{album} - {title}.{ext}' --shell Music/ mkdir -v "Music/__LEFTOVERS" mkdir -v "Music/__STAGE" mkdir -v "Music/__STAGE/rammstein" mv -v "Music/spieluhr.mp3" "Music/__STAGE/rammstein/mutter - spieluhr.mp3" mv -v "Music/links 2 3 4.mp3" "Music/__STAGE/rammstein/mutter - links 2 3 4.mp3" mv -v "Music/ich will.mp3" "Music/__STAGE/rammstein/mutter - ich will.mp3" mv -v "Music/sonne.mp3" "Music/__STAGE/rammstein/mutter - sonne.mp3" mv -v "Music/rein raus.mp3" "Music/__STAGE/rammstein/mutter - rein raus.mp3" mv -v "Music/nebel.mp3" "Music/__STAGE/rammstein/mutter - nebel.mp3" mv -v "Music/adios.mp3" "Music/__STAGE/rammstein/mutter - adios.mp3" mv -v "Music/zwitter.mp3" "Music/__STAGE/rammstein/mutter - zwitter.mp3" mv -v "Music/mein herz brennt.mp3" "Music/__STAGE/rammstein/mutter - mein herz brennt.mp3" mv -v "Music/mutter.mp3" "Music/__STAGE/rammstein/mutter - mutter.mp3" mv -v "Music/feuer frei.mp3" "Music/__STAGE/rammstein/mutter - feuer frei.mp3" mv -v "Music/__STAGE/rammstein" "Music/rammstein" rm -Rv "Music/__STAGE" rm -Rv "Music/__LEFTOVERS" ``--quiet`` ----------- Suppress all normal output: .. code-block:: console $ tagrenamer --quiet Music/ .. code-block:: console Music └── rammstein └── mutter ├── rammstein-1777b3a4c02565cec36c3e5f71f40102.mp3 ├── rammstein-2ec6d3d6fc625fa6ea93ae283175f13c.mp3 ├── rammstein-5bd7b80dbc746b409bc8a6093b65d1c3.mp3 └── rammstein-f3bd509bc5c6d5dd2968695d12293f09.mp3 ``-v`` (debugging) ------------------ Tagrenamer ships with a very detailed debugging facility and this verbosity is controlled using the ``-v`` parameter. The number of ``v``'s you pass, determines the verbosity level which follows the debt of the processed collection tree: .. code-block:: console $ tagrenamer --dry-run --quiet -vvvvv Music/ 00:07:58 <__main__> 00:07:58 00:07:58 00:07:58 __LEFTOVERS 00:07:58 __LEFTOVERS 00:07:58 __STAGE 00:07:58 __STAGE 00:07:58 00:07:58 Music 00:07:58 Music 00:07:58 spieluhr.mp3 00:07:58 'links 2 3 4.mp3' 00:07:58 'ich will.mp3' 00:07:58 sonne.mp3 00:07:58 'rein raus.mp3' 00:07:58 nebel.mp3 00:07:58 adios.mp3 00:07:58 zwitter.mp3 00:07:58 'mein herz brennt.mp3' 00:07:58 mutter.mp3 00:07:58 'feuer frei.mp3' 00:07:58 00:07:58 spieluhr.mp3 00:07:58 'links 2 3 4.mp3' 00:07:58 'ich will.mp3' 00:07:58 sonne.mp3 00:07:58 'rein raus.mp3' 00:07:58 nebel.mp3 00:07:58 adios.mp3 00:07:58 zwitter.mp3 00:07:58 'mein herz brennt.mp3' 00:07:58 mutter.mp3 00:07:58 'feuer frei.mp3' 00:07:58 00:07:58 00:07:58 00:07:58 spieluhr.mp3 00:07:58 'links 2 3 4.mp3' 00:07:58 'ich will.mp3' 00:07:58 sonne.mp3 00:07:58 'rein raus.mp3' 00:07:58 nebel.mp3 00:07:58 adios.mp3 00:07:58 zwitter.mp3 00:07:58 'mein herz brennt.mp3' 00:07:58 mutter.mp3 00:07:58 'feuer frei.mp3' 00:07:58 00:07:58 00:07:58 00:07:58 __STAGE 00:07:58 00:07:58 __LEFTOVERS 00:07:58 ``--format`` ------------ Use ``--format`` to specify how your music folder should be organized. Default format: hash-based naming ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The default behavior leverages unique MD5 hashes for large multi-terabyte music collections and favors naming compatibility over readable filenames: ``{artist}/{album}/{artist}-{hash}.{ext}`` .. code-block:: console Music └── rammstein └── mutter ├── rammstein-1777b3a4c02565cec36c3e5f71f40102.mp3 ├── rammstein-2ec6d3d6fc625fa6ea93ae283175f13c.mp3 └── rammstein-5bd7b80dbc746b409bc8a6093b65d1c3.mp3 Conventional three-level ^^^^^^^^^^^^^^^^^^^^^^^^ ``{artist}/{album}/{artist}-{title}.{ext}`` .. code-block:: console Music └── rammstein ├── mutter │   ├── rammstein-adios.mp3 │   ├── rammstein-feuer frei.mp3 │   ├── rammstein-ich will.mp3 │   └── rammstein-zwitter.mp3 ├── rosenrot │   ├── rammstein-benzin.mp3 │   ├── rammstein-ein lied.mp3 │   └── rammstein-feuer und wasser.mp3 └── sehnsucht ├── rammstein-alter mann.mp3 ├── rammstein-bestrafe mich.mp3 ├── rammstein-bueck dich.mp3 └── rammstein-tier.mp3 Two-level artist-only folders ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``{artist}/{album}-{title}.{ext}`` .. code-block:: console Music └── rammstein ├── mutter-adios.mp3 ├── mutter-feuer frei.mp3 ├── mutter-zwitter.mp3 ├── rosenrot-benzin.mp3 ├── rosenrot-ein lied.mp3 ├── rosenrot-feuer und wasser.mp3 ├── sehnsucht-alter mann.mp3 ├── sehnsucht-bestrafe mich.mp3 └── sehnsucht-tier.mp3 Put it all in one folder because I'm crazy! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``{artist}:{album} - {title}.{ext}`` .. code-block:: console Music/ ├── rammstein:mutter - adios.mp3 ├── rammstein:mutter - feuer frei.mp3 ├── rammstein:mutter - ich will.mp3 ├── rammstein:rosenrot - benzin.mp3 ├── rammstein:rosenrot - ein lied.mp3 ├── rammstein:rosenrot - feuer und wasser.mp3 ├── rammstein:sehnsucht - alter mann.mp3 ├── rammstein:sehnsucht - bestrafe mich.mp3 └── rammstein:sehnsucht - tier.mp3