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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
432a8b71e686ed5f20dda4bafb955fbf39e3dec051ce9da1afdc7993d7fe6959
|
|
| MD5 |
f5ac9583740a5fe9a2c9b33809028d50
|
|
| BLAKE2b-256 |
2933e48970cb93b66719dc424fa91a1b535e70e608267e72d0ed29b6fafe497a
|
Provenance
The following attestation bundles were made for spreen_tracks-0.1.1.tar.gz:
Publisher:
pypi--release.yml on hayat01sh1da/spreen-tracks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spreen_tracks-0.1.1.tar.gz -
Subject digest:
432a8b71e686ed5f20dda4bafb955fbf39e3dec051ce9da1afdc7993d7fe6959 - Sigstore transparency entry: 2205266980
- Sigstore integration time:
-
Permalink:
hayat01sh1da/spreen-tracks@1ab06ef08fb936d3293751f65b017d084d318216 -
Branch / Tag:
refs/tags/python-v0.1.1 - Owner: https://github.com/hayat01sh1da
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi--release.yml@1ab06ef08fb936d3293751f65b017d084d318216 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a853eab2647417d07f7649005a7de5ff4bab1020752792d270187152afc5ba84
|
|
| MD5 |
39e4af2bc18272a8fd4ceb7af35d3454
|
|
| BLAKE2b-256 |
6ae154afc731651fb0ee37a7b1c9ea632626072f44838aa7bd007ed4e673baa2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spreen_tracks-0.1.1-py3-none-any.whl -
Subject digest:
a853eab2647417d07f7649005a7de5ff4bab1020752792d270187152afc5ba84 - Sigstore transparency entry: 2205266995
- Sigstore integration time:
-
Permalink:
hayat01sh1da/spreen-tracks@1ab06ef08fb936d3293751f65b017d084d318216 -
Branch / Tag:
refs/tags/python-v0.1.1 - Owner: https://github.com/hayat01sh1da
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi--release.yml@1ab06ef08fb936d3293751f65b017d084d318216 -
Trigger Event:
push
-
Statement type: