Skip to main content

Read music meta data and length of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files

Project description

tinytag is a library for reading music meta data of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files with python

Build Status Coverage Status

Installation

To install tinytag, simply:

pip install tinytag

Features:

  • Read tags, length and IDv3 cover images of music files

  • supported formats

    • MP3 (ID3 v1, v1.1, v2.2, v2.3+)

    • Wave

    • OGG

    • OPUS

    • FLAC

    • WMA

    • MP4/M4A

  • pure python

  • supports python 2 and 3 (without 2to3)

  • is tested

  • Just a few hundred lines of code (just include it in your project!)

tinytag only provides the minimum needed for reading MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave meta-data. It can determine track number, total tracks, title, artist, album, year, duration and more.

from tinytag import TinyTag
tag = TinyTag.get('/some/music.mp3')
print('This track is by %s.' % tag.artist)
print('It is %f seconds long.' % tag.duration)

List of possible attributes you can get with TinyTag:

tag.album         # album as string
tag.albumartist   # album artist as string
tag.artist        # artist name as string
tag.audio_offset  # number of bytes before audio data begins
tag.bitrate       # bitrate in kBits/s
tag.disc          # disc number
tag.disc_total    # the total number of discs
tag.duration      # duration of the song in seconds
tag.filesize      # file size in bytes
tag.genre         # genre as string
tag.samplerate    # samples per second
tag.title         # title of the song
tag.track         # track number as string
tag.track_total   # total number of tracks as string
tag.year          # year or data as string

Additionally you can also get cover images from ID3 tags:

tag = TinyTag.get('/some/music.mp3', image=True)
image_data = tag.get_image()

supported python versions:

  • 2.6+

  • 3.2+

  • pypy

and possibly more.

Changelog:

  • 0.14.0: MP4/M4A and Opus support

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

tinytag-0.14.2.tar.gz (19.0 kB view details)

Uploaded Source

File details

Details for the file tinytag-0.14.2.tar.gz.

File metadata

  • Download URL: tinytag-0.14.2.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tinytag-0.14.2.tar.gz
Algorithm Hash digest
SHA256 0c4f708d8d2fe3547ec5bc8f4841b22690e7fc9688b404f76e233445f5d5b86c
MD5 2aefbb11b49dbc041be884bec5710383
BLAKE2b-256 7bef9c297cd28cf93c4cdff5650c610e95ec58affb7cc528f5e79347db697c79

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