Giter Club home page Giter Club logo

pytaglib's Introduction

pytaglib-wheel

Warning
This is an obsolete fork of the original pytaglib that was released to provide binary wheels for some platforms. Meanwhile, the original upstream has provided binary wheels. Please switch to https://github.com/supermihi/pytaglib

pytaglib is a Python audio tagging library. It is cross-platform and very 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
>>> with taglib.File("/path/to/my/file.mp3", save_on_exit=True) as song:
>>>     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"] 
>>> # with save_on_exit=True, file will be saved at the end of the 'with' block

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:

    pip install .
    # if you want to run the unit tests, use these commands instead
    # pip install .[tests]
    # python -m pytest

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.

pytaglib's People

Contributors

ardumont avatar gergesh avatar lahwaacz avatar popkornium18 avatar schweinepriester avatar supermihi avatar titusz avatar yassineb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.