Introduction

Requisites

pytag requires Python >= 3.3 and filemagic.

Installation

pip install pytag

Basic usage

>>> from pytag import Audio
>>> audio = Audio('/path/to/file.ogg')
>>> audio.get_tags()
PytagDict({'album': 'a cool album'})

>>> audio.write_tags({'album': 'a new name'})
>>> audio.get_tags()
PytagDict({'album': 'a new name'})

Note

The returned object (PytagDict) extends the Python dict, and can be used as a dict

For more information about PytagDict see: pytag.structures.PytagDict

Is also possible access to the tags/comments as an attribute of the Audio object:

>>> from pytag import AudioReader
>>> audio = Audio('/path/to/file.ogg')
>>> audio.album
'a cool album'

Take a look to the common interface to see all the valid tags/comments values Common interface

Useful Links

Previous topic

pytag - Yet another tool to handle audio metadata

Next topic

Usage

Table Of Contents

This Page