palfrey / tagpy

Python wrapper around TagLib
https://tevps.net/blog/2023/01/03/tagpy/
MIT License
7 stars 1 forks source link
music python tagging

TagPy

PyPI Coverage Status

TagPy is a a set of Python bindings for Scott Wheeler's TagLib. It builds upon Boost.Python, a wrapper generation library which is part of the Boost set of C++ libraries.

Just like TagLib, TagPy can:

All these have their own specific interfaces, but TagLib's generic tag reading and writing mechanism is also supported.

You can find examples in the test/ directory.

Installing TagPy

If you're lucky (Python 3.7-3.9 on x86 Linux currently), you can probably just run pip install tagpy which will use the precompiled wheels. If this fails due to compilation issues, you'll need to install some things first.

TagPy works with

Slightly older versions of gcc and Boost.Python should be fine, but the 1.4 requirement for TagLib is firm. Anything newer is probably ok, and please file bugs for anything that fails.

Using TagPy

Using TagPy is as simple as this:

>>> import tagpy
>>> f = tagpy.FileRef("la.mp3")
>>> f.tag().artist
u'Andreas'

The test/ directory contains a few more examples.

In general, TagPy duplicates the TagLib API, with a few notable exceptions: