Registry / data / mediafile

mediafile

JSON →
library0.17.0pypypi✓ verified 85d ago

A simple, cross-format library for reading and writing media file metadata. Current version 0.17.0, requires Python >=3.10. Part of the beets ecosystem, with monthly releases.

pip install mediafile
INSTALL
IMPORT
SIG · MEDIAFILE
M
mediafile
datapythonv0.17.0
Install
1.7s avg
Import
107ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.17.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.114s · 19.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.100s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MediaFile
from mediafile import MediaFile
from mediafile import Mediafile
Case-sensitive: 'F' uppercase

Basic reading and writing of audio metadata.

from mediafile import MediaFile # Open a file mf = MediaFile('audio.mp3') print(mf.title) print(mf.artist) # Modify metadata mf.title = 'New Title' mf.save()
Debug
Known issues
breakingDropped support for Python 3.7, 3.8, 3.9 in v0.14.0. Requires Python >=3.10.
fix
Upgrade Python to 3.10 or later.
affects: >=0.14.0
breakingMediaFile moved from monolithic mediafile.py to package structure in v0.14.0. Import paths unchanged but internal API may differ.
fix
Update imports: from mediafile import MediaFile (no change needed for basic usage).
affects: >=0.14.0
gotchaFields like 'composers', 'lyricists', 'arrangers' introduced in v0.16.0 are list fields. Assigning a string may fail.
fix
Assign lists: mf.composers = ['Composer A', 'Composer B'].
affects: >=0.16.0
gotchaUnsupported WAV files (e.g., MPEG layer 3 WAV) raise FileTypeError by default since v0.16.1. Use raise_on_unsupported_wav=False to ignore.
fix
MediaFile('file.wav', raise_on_unsupported_wav=False)
affects: >=0.16.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mediafile'
mediafile not installed.
fix
pip install mediafile
ImportError: cannot import name 'MediaFile' from 'mediafile'
Multiple mediafile packages in environment or wrong import path.
fix
Ensure correct package: from mediafile import MediaFile. If conflicting package exists, uninstall: pip uninstall mediafile then pip install mediafile
FileTypeError: WAV file uses unsupported compression format
WAV file with non-PCM format (e.g., MP3 in WAV).
fix
Open with raise_on_unsupported_wav=False: MediaFile('file.wav', raise_on_unsupported_wav=False)
Upgrade
Version history
0.17.0latest on PyPI · released Apr 24, 2026
Audit
Dependencies
mutagenrequiredUnderlying metadata parsing for all audio formats
Agent activity
4 hits · last 30 days
node
4
Resources
mediafile — pip install mediafile · libregistry