Skip to main content

cross-platform, Python audio metadata ("tagging") library based on TagLib

Project description

pytaglib

PyPI

pytaglib is a Python audio tagging library. It is cross-platform and svery simple to use yet fully featured:

pytaglib is a very thin wrapper (≈150 lines of code) around the fast and rock-solid TagLib C++ library.

News

See the Changelog.

Get it

At first, you might need to install taglib with development headers. Ubuntu, Mint and other Debian-Based distributions:

    sudo apt install libtag1-dev

On a Mac, use HomeBrew:

    brew install taglib

Then install pytaglib with pip:

    pip install pytaglib

For other operating systems and more details, see installation notes below.

Usage

>>> import taglib
>>> song = taglib.File("/path/to/my/file.mp3")
>>> song.tags
{'ARTIST': ['piman', 'jzig'], 'ALBUM': ['Quod Libet Test Data'], 'TITLE': ['Silence'], 'GENRE': ['Silence'], 'TRACKNUMBER': ['02/10'], 'DATE': ['2004']}

>>> song.length
239
>>> song.tags["ALBUM"] = ["White Album"] # always use lists, even for single values
>>> del song.tags["DATE"]
>>> song.tags["GENRE"] = ["Vocal", "Classical"]
>>> song.tags["PERFORMER:HARPSICHORD"] = ["Ton Koopman"] 
>>> song.save()

For detailed API documentation, use the docstrings of the taglib.File class or view the source code directly.

pyprinttags

This package also installs the pyprinttags script. It takes one or more files as command-line parameters and will display all known metadata of that files on the terminal. If unsupported tags (a.k.a. non-textual information) are found, they can optionally be removed from the file.

Installation Notes

  • Ensure that pip is installed and points to the correct Python version
    • on Windows, be sure to check install pip in the Python installer
    • on Debian/Ubuntu/Mint, install python3-pip
    • you might need to type, e.g., pip-3 to install pytaglib for Python 3 if your system's default is Python 2.x.
  • For Windows users, there are some precompiled binary packages (wheels). See the PyPI page for a list of supported Python versions.
  • If no binary packages exists, you need to have both Python and taglib installed with development headers (packages python3-dev (or python-dev) and libtag1-dev for debian / ubuntu and derivates, python-devel and taglib-devel for fedora and friends, brew install taglib on OS X).

Linux: Distribution-Specific Packages

  • Debian- and Ubuntu-based linux flavors have binary packages for the Python 3 version, called python3-taglib. Unfortunatelly, they are heavily outdated, so you should instally the recent version via pip whenever possible.
  • For Arch users, there is a package in the user repository (AUR).

Manual Compilation: General

You can download or checkout the sources and compile manually:

    python setup.py build
    python setup.py test  # optional, run unit tests
    sudo python setup.py install

Note: The taglib Python extension is built from taglib.cpp which in turn is auto-generated by Cython from taglib.pyx. To regenerate the taglib.cpp after making changes to taglib.pyx, set the environment variable PYTAGLIB_CYTHONIZE to 1 before calling setup.py or pip.

Compilation: Windows

Install MS Visual Studio Build Tools (or the complete IE) and include the correct compiler version as detailed here. Also enable cmake in the Visual Studio Installer.

Then:

  • open the VS native tools command prompt
  • navigate to the pytaglib repository
  • run python build_taglib_windows.py which will download and build the latest official TagLib release
  • run python setup.py install

Contact

For bug reports or feature requests, please use the issue tracker on GitHub. For anything else, contact me by email.

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

pytaglib-1.5.0.tar.gz (467.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pytaglib-1.5.0-py3.10-win-amd64.egg (218.0 kB view details)

Uploaded Egg

pytaglib-1.5.0-py3.10-linux-x86_64.egg (190.9 kB view details)

Uploaded Egg

pytaglib-1.5.0-py3.9-win-amd64.egg (217.9 kB view details)

Uploaded Egg

pytaglib-1.5.0-py3.9-linux-x86_64.egg (186.5 kB view details)

Uploaded Egg

pytaglib-1.5.0-py3.8-win-amd64.egg (218.1 kB view details)

Uploaded Egg

pytaglib-1.5.0-py3.8-linux-x86_64.egg (195.3 kB view details)

Uploaded Egg

pytaglib-1.5.0-cp310-cp310-win_amd64.whl (228.6 kB view details)

Uploaded CPython 3.10Windows x86-64

pytaglib-1.5.0-cp39-cp39-win_amd64.whl (228.6 kB view details)

Uploaded CPython 3.9Windows x86-64

pytaglib-1.5.0-cp38-cp38-win_amd64.whl (228.7 kB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file pytaglib-1.5.0.tar.gz.

File metadata

  • Download URL: pytaglib-1.5.0.tar.gz
  • Upload date:
  • Size: 467.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0.tar.gz
Algorithm Hash digest
SHA256 8f7603dffdb1930428b305e79b8ca127e9cffc4ce4d2f7440a5f5226a82e6e5f
MD5 1176897de0d2943a3c6814634657fa66
BLAKE2b-256 eabbbdd8aa96668820731f8eb871a938efbf535cf70a3fbe2939d3323dfb0228

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-py3.10-win-amd64.egg.

File metadata

  • Download URL: pytaglib-1.5.0-py3.10-win-amd64.egg
  • Upload date:
  • Size: 218.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-py3.10-win-amd64.egg
Algorithm Hash digest
SHA256 37fa1cd3f58c2814c5b7acad29a40f202ec6e20763c1c875c0512b1f27ec0b58
MD5 a94973f99a62a1ea6d8e5b506bd7f937
BLAKE2b-256 d6c9abef58f2aa7c682b500f21ffa0ddcf0bedc0d129756ea5203009b94b2e45

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-py3.10-linux-x86_64.egg.

File metadata

  • Download URL: pytaglib-1.5.0-py3.10-linux-x86_64.egg
  • Upload date:
  • Size: 190.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-py3.10-linux-x86_64.egg
Algorithm Hash digest
SHA256 1b05826b7793d85adfbe1b5f6c6a97920a24f83b66b3d8bdc1b040b788d9d1ae
MD5 4890fcc35cfe10eaf7f44f7d22682981
BLAKE2b-256 b08671097d8dd8ad05286089764de7c3e29f7b79b83a86facaf7a75ba33dd704

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-py3.9-win-amd64.egg.

File metadata

  • Download URL: pytaglib-1.5.0-py3.9-win-amd64.egg
  • Upload date:
  • Size: 217.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-py3.9-win-amd64.egg
Algorithm Hash digest
SHA256 006a65af9a82fa143f8e2679335efed5f643c20b338245140dbb44094934f23c
MD5 203ce7533fa4cc3c7a29eb429c16887c
BLAKE2b-256 214f00d4f3100fedf5fecf04702e1b848cdb7342744624a7b4e322213a667afe

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-py3.9-linux-x86_64.egg.

File metadata

  • Download URL: pytaglib-1.5.0-py3.9-linux-x86_64.egg
  • Upload date:
  • Size: 186.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-py3.9-linux-x86_64.egg
Algorithm Hash digest
SHA256 446fad443cc8a3515394aec5c623857ea7939a97016f9a567482f66832f8bd81
MD5 79a63bddcc97c605161418ae46f6ecb3
BLAKE2b-256 2e84fc97d189ca09b1b00de3e1ddb1f1d014772fca46d90728fa93aef2158fb4

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-py3.8-win-amd64.egg.

File metadata

  • Download URL: pytaglib-1.5.0-py3.8-win-amd64.egg
  • Upload date:
  • Size: 218.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-py3.8-win-amd64.egg
Algorithm Hash digest
SHA256 2357d14b6b5f6c3867bc169673587016ec9314287a943f1ad209d0fbe09db795
MD5 0300cd4e6bff80a058dc43a97239a921
BLAKE2b-256 128451907c97785f2c1b41737d08102c586d7d4cd9c07a52c9638da8d79fc269

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-py3.8-linux-x86_64.egg.

File metadata

  • Download URL: pytaglib-1.5.0-py3.8-linux-x86_64.egg
  • Upload date:
  • Size: 195.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-py3.8-linux-x86_64.egg
Algorithm Hash digest
SHA256 5d60f2777c6b1950db91b9ed750e4663593358abf016fbd8f99e222c1008082d
MD5 35fd84f649881e516505b3484b2391c4
BLAKE2b-256 298ef3c448278a78cbdc87c5cd603a8a804856f774a914f3f4dc86f8355ebb34

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pytaglib-1.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 228.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4bc09366c02e864e533956a04d95574ec7d2c0cf3c1ad8041e327f679769b5a7
MD5 5b2b9c28884c4a684e91c639b30af20f
BLAKE2b-256 1bda0de2dbf21aa91fd49d6b35ba620808f7e7e287c26a2c124bec60b67f9e97

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pytaglib-1.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 228.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 49487f390aa605cf5ebc72d5a74e53a843fb74a60946ffa7b1c970e2fa6b46d3
MD5 e394f514c0b3e8a8c274303a5302b309
BLAKE2b-256 11853cfbbf6f5c949602a2a5d830af12b30796f8dcc17fea3db47909a3623696

See more details on using hashes here.

File details

Details for the file pytaglib-1.5.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pytaglib-1.5.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 228.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pytaglib-1.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e13d8cf999fb6407fa56db6ef6a0a317484e49324706fcb813de7c82a637d9d5
MD5 9e6fdb038a58746ac052c042c894619e
BLAKE2b-256 2c8d920d1385a51a58721866177ae8ca33fbaa428a29030dbac6bc46307a03c9

See more details on using hashes here.

Supported by

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