Skip to main content

GitHub last commit

Lint and Test

mfbatch

mfbatch is a command-line tool for batch-editing FLAC audio file metadata. It reads a directory of FLAC files, extracts the existing metadata to an intelligent text file format that the user can modify to update a large number of files and dynamic per-file metadata with a minimal number of edits.

mfbatch is a front-end for metaflac(1) which must be installed on the system.

Motivation

I've been reorganzing my sound effects library recently and have had to edit a large number of FLAC files, adding and editing descriptions, normalizing fields etc. and this is one of the tools I've come up with for updating a large number of FLAC files in an easy way quickly. It works completely in the command line and is designed to be used with your favorite text editor.

Workflow

1) Create a new MFBATCH_LIST file for a directory of FLAC files.

$ cd path/to/my/flacs 
$ mfbatch -c 

mfbatch will scan the current working directory and all subdirectories recursively. You can use a -p option to switch to another directory before scanning.

2) Edit the MFBATCH_LIST file in your $EDITOR.

$ mfbatch --edit

The MFBATCH_LIST file will contain a transcript of all of the flac files in the selected folder along with their current metadata.

:set ALBUM 'Test Album 1'
:set ARTIST 'Test Artist'
:set DESCRIPTION 'Tone file #1, test tone 440Hz'
:setp TITLE DESCRIPTION "^Tone file #(\d+).*" 'Tone \1'
./tone1.flac

:set DESCRIPTION 'Tone file #2, also 440Hz'
./tone2.flac
:unset DESCRIPTION

:set DESCRIPTION 'Tone file #3'
./tone3.flac

The MFBATCH_LIST format allows you to set metadata once and then write values to a run of files all at once. Several commands are available to manipulate the metadata written to the files.

3) After you've made the changes you want to make, write them to the files.

$ mfbatch -W

Writing metadata is interactive, mfbatch will display the metdata to be written to each file and metadata can be edited interactively at a prompt before writing.

Limitations

  • Does not support newlines in field values. This is mostly by choice, newlines don't offer any benefit in my preferred sound library programs but this wouldn't be a tough feature to add if anyone needed it.
  • Does not support multiple artwork types, everything is stored as type 3/ (album artwork-front).
  • Can only store unique field keys, field values of the same key overwrite old values. This is also something that is tailored to my use-case and could be changed if there was interest in doing so.

Metadata

Release files for mfbatch 0.6.0

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

Source distribution (sdist)

Source distribution for mfbatch 0.6.0
File Size Uploaded
mfbatch-0.6.0.tar.gz 9.1 kB Details

Built distribution (wheel)

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

Total release size: 20.2 kB

Release files / mfbatch-0.6.0.tar.gz

Download URL mfbatch-0.6.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e178a2f945b05e684c1140f862c51519d801954c477dd28a824150a7dfb7290b
BLAKE2b-256 checksum
How to use checksums
751f3913f859be047e8254393f86e93a87797560858ea418f5b1b3a539a753fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2025.

Transparency log

Release files / mfbatch-0.6.0-py3-none-any.whl

Download URL mfbatch-0.6.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bb60df40480a16e0b52d5f7c9fe8df6f0bdcad59617d94e730b0d933c87b7a3
BLAKE2b-256 checksum
How to use checksums
8e995162810eafd584258a2db04c4ea01bbd2e305a64e271fdc19f7d3ec3bdad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.2

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.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