Skip to main content

Rename music files and album directories automatically

Project description

flacfixer

A program to automatically manage the filenames of your music directory.

builds.sr.ht status

Install

git clone https://git.sr.ht/~rensoliemans/flacfixer
pip install .

Or, if you'd like to run linters,

pip install .[dev]

Or, if you want an editable install,

pip install -e .

Run

$ flacfixer --help
usage: flacfixer [-h] (-a | -f) [-n] [-r RECURSE_LEVELS] [-v]

Fix filenames in my music dir

options:
  -h, --help            show this help message and exit
  -a, --albums          Fixes album names (directories) in PWD
  -f, --filenames       Fixes filenames in PWD
  -n, --dry-run         Perform dry run and output what would be changed
  -r RECURSE_LEVELS, --recurse-levels RECURSE_LEVELS
                        Levels to recurse into. Defaults to 0, current level
  -v, --verbose         Be verbose. Pass multiple times to increase verbosity

This is specific to my music library and preferences:

Filenames

flacfixer -f changes the filenames of music files. Only flac is currently supported. The target is {tracknumber} - {title}.flac, where tracknumber always has length 2. tracknumber and title are extracted from metadata.

Example: 01 - Rosalyn.flac

Albums

flacfixer -a changes the directory names into the following format: {album name} [{year}]. Since a directory itself can't have any metadata, it attempts to parse the title and year from the current directory format. See test_album_fixer.py.

Example: Tripping with Nils Frahm [2020]

Contributions

Code style

Code style: black

This project uses black, ruff and pre-commit. They are all installed when you do pip install -e .[dev].

Install pre-commit hooks with

pre-commit install

make commands:

  • make lint: executes black and ruff. This is also more or less what pre-commit does.

  • make analyse: make lint and mypy

  • make test: unittests

  • make check: make analyse and make test (everything)

Contributing

I'm new to mailing lists with git, but please send patches to ~rensoliemans/flacfixer@lists.sr.ht.

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

flacfixer-1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

flacfixer-1.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file flacfixer-1.0.tar.gz.

File metadata

  • Download URL: flacfixer-1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for flacfixer-1.0.tar.gz
Algorithm Hash digest
SHA256 dc02501a5ccf60b284663a18f3f1a3c54aef2fc2d21ec11b0534fc463a44cb56
MD5 3b26f7ede2cfb9f41edcf21167aa52cb
BLAKE2b-256 2d505953a934c0551cf94f1787f87d3640fded807783a52d23294b26ec04cd3f

See more details on using hashes here.

File details

Details for the file flacfixer-1.0-py3-none-any.whl.

File metadata

  • Download URL: flacfixer-1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for flacfixer-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ad8703db131075788d3e2ea4d28ab557a2d53d7ba9811f2a5b012de16e98743
MD5 2b9547cc4370ebc3c6c5f481873ac11c
BLAKE2b-256 9331bd35003927fc6ad8cb2fc05ab47d5d157a91bfcb0f23e1c333c0013a4c85

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page