Skip to main content

Python Bindings for TagLib

Project description

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:

  • read and write ID3 tags of version 1 and 2, with many supported frame types for version 2 (in MPEG Layer 2 and MPEG Layer 3, FLAC and MPC),
  • access Xiph Comments in Ogg Vorbis Files and Ogg Flac Files,
  • access APE tags in Musepack and MP3 files.
  • access ID3 version 2 tags in WAV files

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.9-3.13 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.

  • Debian: apt-get install libboost-python-dev libtag1-dev
  • Fedora: dnf install boost-python3-devel taglib-devel
  • Alpine 3.17: apk add taglib-dev boost1.80-python3 (or another boost*-python3 for other alpine versions) Other setups are not currently supported, but patches with CI checking for others are welcomed.

TagPy works with

  • TagLib >=1.9 (all versions up to 2.0.2 currently tested)
  • Boost.Python 1.74
  • gcc 10.2.1

Slightly older versions of gcc and Boost.Python should be fine, but the 1.9 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:

  • Namespaces (i.e. Python modules) are spelled in lower case. For example, TagLib::Ogg::Vorbis is now taglib.ogg.vorbis.

  • Enumerations form their own scope and are not part of any enclosing class scope, if any.

    For example, the value TagLib::String::UTF16BE from the enum TagLib::String::Type is now tagpy.StringType.UTF16BE.

  • TagLib::String objects are mapped to and expected as Python unicode objects.

  • TagLib::ByteVector objects are mapped to regular Python string objects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tagpy-2025.1.tar.gz (143.9 kB view details)

Uploaded Source

Built Distributions

tagpy-2025.1-cp313-cp313-manylinux_2_34_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

tagpy-2025.1-cp312-cp312-manylinux_2_34_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

tagpy-2025.1-cp311-cp311-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

tagpy-2025.1-cp310-cp310-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

tagpy-2025.1-cp39-cp39-manylinux_2_34_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file tagpy-2025.1.tar.gz.

File metadata

  • Download URL: tagpy-2025.1.tar.gz
  • Upload date:
  • Size: 143.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for tagpy-2025.1.tar.gz
Algorithm Hash digest
SHA256 def366568dd0a96845dd27e2e3ae1c1c506c68ded863b2c4bf224f0f91a0704d
MD5 958993fdc65eee3d4023cfe5dcc9a325
BLAKE2b-256 470c862803814efed6c829520778533a58a9f6ed8683f1420c5e7773a95a8a46

See more details on using hashes here.

File details

Details for the file tagpy-2025.1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2025.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a29d3a2a05ce20470662428eec1f107b6e78dd4eeb50af419e4c37ed0f67da21
MD5 d419f583050db9215b3840fd2a9b9814
BLAKE2b-256 b57f5460b01cc3d3d2232f1df0939e7c8e502023d82e5c1ea86a8fec40b2dd36

See more details on using hashes here.

File details

Details for the file tagpy-2025.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2025.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 66434b5578812037ea7cdb8cdf62b9f7cd22e63a180141b9262adf70e38087e3
MD5 bddb4952587e09d7f4a9f8a854d1991f
BLAKE2b-256 100d3a5e17de31410c26201d2370bb04a0150ae5cc9321dc8d2249b7fbb42243

See more details on using hashes here.

File details

Details for the file tagpy-2025.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2025.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a41e524c2a6fe71814bf26a89d5f37d5c95d1864d33f4e92ce6aae0cbfcc1384
MD5 235bb240e20fa4fe669398e52fc5ead8
BLAKE2b-256 6f752761e507aba4872de5a3415b18b36ab7e435c27039c2a7cafbe3868df873

See more details on using hashes here.

File details

Details for the file tagpy-2025.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2025.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 07a1fc5e4a361523b2ed9e7fbd9613b7fdd793bc46b3b1053a370a72de1075a0
MD5 14075f2aee942080f844063c2277bd70
BLAKE2b-256 9d1d816a0742d576d404432223b6edb16aac5ea9ec8bf5cd96338c17e36d1f70

See more details on using hashes here.

File details

Details for the file tagpy-2025.1-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2025.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d37941a068fb8c14ff91da1e0210d607c7e00023b63870255fc8de5ebed5cfc7
MD5 e5f0dd43cb06a7f2718a43a0e1d0a9c6
BLAKE2b-256 a33914afee09cfa67b01d6d42f533e83c02cbdda22d758e5e4a740ebd1f62a36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page