Skip to main content

EzAudioMeta

Build Status Build Status

Python Script that allows you to re-name meta data fields from audio files in a directory.

The usage so far:

Requirements:

  • Python 3.9.1: Maaaaybe it might work in lower versions, but can't guarantee anything. I made use of f-strings where i could, so i'd recommend Python 3.6 at the very least-
  • mutagen 1.45.1 (and it's dependencies)
  • Click 7.1.2.

Usage:

For direct usage:

py main.py --file path/to/audio/file [options]

Installing from pip:

pip install EzAudioMeta

ezaudio --file path/to/audio/file [options]

Options:

Each option represents a tag to be set. All tags must be either text or a number. Note that numbers can also be parsed from text, so if you pass tracknumber tag as "15", it will work just fine. For safety, all text should be encased between double quotes.

  --file TEXT
  --files-directory TEXT
  --from-file TEXT
  --album TEXT
  --albumartist TEXT
  --artist TEXT
  --comment TEXT
  --compilation INTEGER
  --composer TEXT
  --discnumber INTEGER
  --genre TEXT
  --lyrics TEXT
  --totaldiscs INTEGER
  --totaltracks INTEGER
  --tracknumber INTEGER
  --tracktitle TEXT
  --year INTEGER
  --isrc TEXT
  --parse-title-capitalize TEXT  Parses the 'tracktitle' from the actual file
                                 name. The track title is capitalized as a
                                 title. You must provide a valid regex
                                 expresion. Ej. (?<=\d\d\s).+(?=\.flac).

  --parse-title-as-is TEXT       Parses the 'tracktitle' from the actual file
                                 name. The track title is left as is with no
                                 capitalization or processing. You must
                                 provide a valid regex expresion. Ej.
                                 (?<=\d\d\s).+(?=\.flac).

  --parse-title-clean TEXT       Parses the 'tracktitle' from the actual file
                                 name. The track title has all '-', '_' and
                                 multiple whitespacesremoved and trimmed, and
                                 then is title capitalized. You must provide a
                                 valid regex expresion. Ej.
                                 (?<=\d\d\s).+(?=\.flac).

  --parse-track-number TEXT      Parses the 'tracknumber' from the actual file
                                 name. You must provide a valid regex
                                 expresion. Ej. \d+(?=.+\.mp3).
  --help                 Show this message and exit.

Single file as an example:

py main.py --file "track 01.mp3" --tracktitle "Track Title"
--tracknumber "12" --album "Album Name"

Directory as an example:

py main.py --files-directory "path/to/files" --artist "Artist" --album "Album Name" --genre "Genre" --year 1966

Note: Files are file system dependant, so if you are in windows: path\to\file and in linux: path/to/file. This script does distinguish between OSes (Windows and Linux so far)

Using --from-file:

This options lets you load the options from a text file, line by line, something like this:

file=value
files-directory=value
album=value
albumartist=value
artist=value

Please note that you shouldn't use file and files-directory together. Also note that all options are missing the -- at the beginning, and there is an = for separation.

You should call the script like this:

py main.py --from-file "path/to/your/text/file.txt"

Parsing track titles from file name using Regex.

EzAudioMeta allows to parse the 'tracktitle' tag from the actual file name using regular expressions. Usage is as follows

py main.py --from-file "path/to/your/text/file.txt" --parse-title-capitalize "(?<=\d\d\s).+(?=\.flac)"

Given an audio file 01 my_track_title.flac, the expected result should be:

  • --parse-title-capitalize: My_Track_Title
  • --parse-title-as-is: my_track_title
  • --parse-title-clean: My Track Title

Parsing track number from file using regex.

Ypu can also get the track number from the audio file using regex:

py main.py --file "path\to\39_audio_test_file_3.mp3" --parse-track-number "\d+(?=.+\1.mp3)"

track number gets tagged as 39. If no match is found, 0 i assigned by default.

Release files for EzAudioMeta 0.2

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

Source distribution (sdist)

Source distribution for EzAudioMeta 0.2
File Size Uploaded
EzAudioMeta-0.2.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for EzAudioMeta 0.2
File Interpreter ABI Platform
EzAudioMeta-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 kB

Release files / EzAudioMeta-0.2.tar.gz

Download URL EzAudioMeta-0.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d1de63733b3e70c5c7a2f8eceb401f0338d8d69d13a7f18e65a6fc8c65462342
BLAKE2b-256 checksum
How to use checksums
86a9444e1d77aa7eb84af95822746213ef8139ca0afe443a949aca5ca1195622
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.1

Release files / EzAudioMeta-0.2-py3-none-any.whl

Download URL EzAudioMeta-0.2-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b1e47bcaef6d3e3f51bf0bcc1764786c80f1a6d5e3f898db261f28f9179d6a
BLAKE2b-256 checksum
How to use checksums
3f4b32941e902ec291457916bd0e27c1b51cace018e928b269539661028f3efd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

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