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

  • 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.4
  • Boost.Python 1.74
  • gcc 10.2.1

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:

  • 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-2022.1.tar.gz (140.8 kB view details)

Uploaded Source

Built Distributions

tagpy-2022.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tagpy-2022.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

tagpy-2022.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: tagpy-2022.1.tar.gz
  • Upload date:
  • Size: 140.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for tagpy-2022.1.tar.gz
Algorithm Hash digest
SHA256 8939bf0ccd7c4e776feccb1d5e7b72f31e11a0c8c5f9e37154bad6a9fa444bff
MD5 9e073a966d56b7dfaa6aed0f4cc1182b
BLAKE2b-256 21b6357e0d9ef244b330fc119b3e7699a780b4044d152274424c02cd38d02de9

See more details on using hashes here.

File details

Details for the file tagpy-2022.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2022.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76c0e9fb43d4b5fe9d2fdd88387669ca5ead102cab21d8b5f13f81322d0e19fc
MD5 3c0bf215a1feaf6c73788f461beb152d
BLAKE2b-256 bf66ab5f392527f49ac9d62b1d1182dfbb4f79b46c298b095d2848cebd2efedf

See more details on using hashes here.

File details

Details for the file tagpy-2022.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2022.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50eda00e151a4bb27c50452a2f23eddebb6d0574fa043e3ad254ddb5a28299f4
MD5 53678b6279d4ef3c003bfcbb619ff264
BLAKE2b-256 d52f4eaeaf98e7f91114579f3106710236fb1f3cccda82b9f961bc283c723d25

See more details on using hashes here.

File details

Details for the file tagpy-2022.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tagpy-2022.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0535daa11972cef51a061f0142e1aee1f96bf41db84d0ccdeb7e4e4ffe344ac1
MD5 e5d2d01b328a34c15a6b4ac59db960bc
BLAKE2b-256 04cc1665347408ea6e12b779520b6caa763de12ecbe6e5ddf54dff4549aee7ce

See more details on using hashes here.

Supported by

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