1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
Metadata-Version: 2.2
Name: tagpy
Version: 2025.1
Summary: Python Bindings for TagLib
Home-page: https://github.com/palfrey/tagpy
Author: Tom Parker-Shemilt
Author-email: palfrey@tevp.net
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping
Classifier: Topic :: Multimedia :: Sound/Audio :: Editors
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.9, <4
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging>=14.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary
TagPy
=====
[](https://pypi.org/project/tagpy/)
[](https://coveralls.io/github/palfrey/tagpy)
TagPy is a a set of Python bindings for [Scott Wheeler's TagLib](https://taglib.org/). It builds upon [Boost.Python](http://www.boost.org/libs/python/doc/), a wrapper generation library which
is part of the [Boost set of C++ libraries](http://www.boost.org).
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.
|