Skip to main content

Build Status Coverage

Audiobooks from mp3 with broken tags

Fix mp3 files tags to convert them into iTunes/iPhone audiobooks.

  • Fixes sort order.
  • Supports messed encoding like cyrillic Win1251.

Details in my blog's article.

Installation

Install using pipx for isolated environments, which prevents interference with your system's Python packages.

Once pipx is set up:

pipx install audiobook-tags

Command Line Interface

Usage

audiobook-tags [-h] [--encoding ENCODING] [--extension EXTENSION] [--set-tag [SET_TAG ...]] [--track-num TRACK_NUM] [--title-prefix TITLE_PREFIX] [--dry] [folder]

Fixes mp3 tags for iOS audiobooks.

positional arguments:
  folder                Folder to process. By default current folder.

options:
  -h, --help            show this help message and exit
  --suffix SUFFIX, -s SUFFIX
                        Files suffix. By default mp3
  --encoding ENCODING, -e ENCODING
                        mp3 tags encoding. "none" if you do not need mp3 tags encoding fix. By default "cp1251".
  --tag [SET_TAG ...], -t [SET_TAG ...]
                        Change mp3 tag to specified string. Format "tag-name/tag-value".
  --num TRACK_NUM, -n TRACK_NUM
                        Sort files and set mp3 tag `track_num`:
                          --num="name" - sort by names;
                          --num="tag-<TAG>" - sort by mp3 tag with name <TAG>.
                            For example to sort by title tag use --num="tag-title".
  --prefix TITLE_PREFIX, -p TITLE_PREFIX
                        Add prefix to title tags. By default `{track:04} - ` if `--num` and no prefix if not.
  --dry, -d             Dry run without changing files.
  --version, -v         Print verbose output including list of processed files.

Example:

audiobook-tags --tag="album_artist/Юрий Заборовский (Ардис)" --num="name" --prefix=""
  • converts all mp3 files in current folder and subfolders
  • fix encoding supposing that original encoding was Windows 1251
  • change tag album artist.
  • set track_num mp3 tag to file number as ordered by file name. But do not add the track number to the title (--prefix=""").

Development

OS Dependencies

MacOS

brew update brew install libmagic

Python dependencies

Note the dot before ./activate.sh:

. ./activate.sh

We use eyeD3 to work with mp3 tags.

Coverage report

Created with cookiecutter using template

Metadata

Release files for audiobook-tags 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audiobook-tags 1.3.3
File Size Uploaded
audiobook_tags-1.3.3.tar.gz 7.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for audiobook-tags 1.3.3
File Interpreter ABI Platform
audiobook_tags-1.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 MB

Release files / audiobook_tags-1.3.3.tar.gz

Download URL audiobook_tags-1.3.3.tar.gz
Size 7.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b54cb8f159e9422748246a7b8120d187122e4488f025c25327fe7ee8169fdfc0
BLAKE2b-256 checksum
How to use checksums
b57076bf7e82ce0f60e2ea7dcf0c75539726db67576dfddd4d38e354168c7e0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / audiobook_tags-1.3.3-py3-none-any.whl

Download URL audiobook_tags-1.3.3-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3eb638311dfce5071979451b12afd8d6c7113c8bf3d8cdf6d87bbe04979d6f5b
BLAKE2b-256 checksum
How to use checksums
1987e5626fee6526fb243b56060a9bb36f443432d664d6afb8a25c3eb9618e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.3.3 This release

2 release files

1.2.9

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page