Skip to main content

Normalise iTunes-imported track filenames with a configurable delimiter and DiscN folders.

Project description

1. Environment

  • Python 3.14.6
  • pip 26.1.2

2. Installation

$ pipx install spreen-tracks

(pip install spreen-tracks works too if you prefer managing the environment yourself.)

For development, install the dependencies via requirements.txt:

$ pip install -r requirements.txt

3. Execution

Run the command inside your music directory — with no options it dry-runs, printing every rename it would perform without touching a file:

$ cd ~/Music
$ track-delimiter
Target extension is `.m4a`
========== [DRY RUN] Total File Count to Clean: 4 ==========
========== [DRY RUN] The delimiters of those files will be replaced with `_` ==========
========== [DRY RUN] Start! ==========
========== [DRY RUN] Replacing the delimiter: `./Artist/Album1/1-01 Title.m4a` => `./Artist/Album1/Disc1/01_Title.m4a` ==========
========== [DRY RUN] Replacing the delimiter: `./Artist/Album1/2-01 Title.m4a` => `./Artist/Album1/Disc2/01_Title.m4a` ==========
========== [DRY RUN] Replacing the delimiter: `./Artist/Album2/01 Title.m4a` => `./Artist/Album2/01_Title.m4a` ==========
========== [DRY RUN] Replacing the delimiter: `./Artist/Album2/02 Title.m4a` => `./Artist/Album2/02_Title.m4a` ==========
========== [DRY RUN] Done! ==========
========== [DRY RUN] Total Target File Count: 4 ==========

When the plan looks right, execute it with --mode e; --extension and --delimiter override the defaults:

$ track-delimiter --mode e
$ track-delimiter --extension .mp3 --delimiter - --mode e

As a library:

from spreen_tracks import Application

Application.run()                            # dry run over ./**/*.m4a
Application.run(delimiter='-', mode='e')     # execute the renames

4. Unit Test

$ pytest
============================= test session starts ==============================
platform linux -- Python 3.14.6, pytest-9.1.1, pluggy-1.6.0
rootdir: spreen-tracks/PyPI
configfile: pyproject.toml
collected 9 items

test/test_application.py ....                                            [ 44%]
test/test_cli.py .....                                                   [100%]

============================== 9 passed in 0.16s ===============================

5. Static Code Analysis

$ flake8 .
$ autoflake8 --in-place --remove-duplicate-keys --remove-unused-variables --recursive .
$ autopep8 --in-place --aggressive --aggressive --recursive .

6. Type Checks

$ mypy .
Success: no issues found in 6 source files

7. Build

$ python -m build
$ pipx install ./dist/spreen_tracks-0.1.0-py3-none-any.whl

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

spreen_tracks-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spreen_tracks-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file spreen_tracks-0.1.1.tar.gz.

File metadata

  • Download URL: spreen_tracks-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for spreen_tracks-0.1.1.tar.gz
Algorithm Hash digest
SHA256 432a8b71e686ed5f20dda4bafb955fbf39e3dec051ce9da1afdc7993d7fe6959
MD5 f5ac9583740a5fe9a2c9b33809028d50
BLAKE2b-256 2933e48970cb93b66719dc424fa91a1b535e70e608267e72d0ed29b6fafe497a

See more details on using hashes here.

Provenance

The following attestation bundles were made for spreen_tracks-0.1.1.tar.gz:

Publisher: pypi--release.yml on hayat01sh1da/spreen-tracks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spreen_tracks-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spreen_tracks-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for spreen_tracks-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a853eab2647417d07f7649005a7de5ff4bab1020752792d270187152afc5ba84
MD5 39e4af2bc18272a8fd4ceb7af35d3454
BLAKE2b-256 6ae154afc731651fb0ee37a7b1c9ea632626072f44838aa7bd007ed4e673baa2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spreen_tracks-0.1.1-py3-none-any.whl:

Publisher: pypi--release.yml on hayat01sh1da/spreen-tracks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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