Skip to main content

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

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.6+ and 3.2+

  • 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.18.0: fixed wrong bitrate and crash when parsing xing header

  • 0.17.0: supporting ID3v2.2 images

  • 0.16.0: MP4 cover image support

  • 0.15.2: fixed crash for malformed MP4 files (#34)

  • 0.15.0: fixed decoding of UTF-16LE ID3v2 Tags, improved overall stability

  • 0.14.0: MP4/M4A and Opus support

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.18.0.tar.gz (19.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for tinytag-0.18.0.tar.gz
Algorithm Hash digest
SHA256 8c86ea2cf812a9aff2d61b04fe954bd3feaeb4053f59809b7d1e09ea03be7cd3
MD5 7d24b37a80c062bb83bf8f41b5260bbe
BLAKE2b-256 12504aabee900af283a357a8720b03457bad881b826ad1fd3f5dbd805ea501e9

See more details on using hashes here.

Release history Release notifications | RSS feed

2.3.1

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.10.1

2 files

1.10.0

2 files

1.9.0

1 file

1.8.1

1 file

1.8.0

1 file

1.7.0

1 file

1.6.0

1 file

1.5.0

1 file

1.4.0

1 file

1.3.1

1 file

1.2.2

1 file

1.2.1

1 file

1.2.0

1 file

1.1.0

1 file

1.0.1

1 file

1.0.0

1 file

0.20.0

1 file

This release

0.18.0 This release

1 file

0.17.0

1 file

0.16.0

1 file

0.15.2

1 file

0.15.0

1 file

0.14.2

1 file

0.14.1

1 file

0.14.0

0.13.1

1 file

0.12.0

1 file

0.11.0

1 file

0.10.1

1 file

0.10.0

1 file

0.9.3

1 file

0.9.2

1 file

0.9.1

1 file

0.9.0

1 file

0.8.1

1 file

0.8.0

1 file

0.7.2

1 file

0.7.1

1 file

0.6.1

1 file

0.6.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page