Giter VIP home page Giter VIP logo

tinytag's Introduction

tinytag

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.19.0 (2018/02/11): fixed corrupted images for some mp3s (#45)
  • 0.18.0 (2017/04/29): fixed wrong bitrate and crash when parsing xing header
  • 0.17.0 (2016/10/02): supporting ID3v2.2 images
  • 0.16.0 (2016/08/06): MP4 cover image support
  • 0.15.2 (2016/08/06): fixed crash for malformed MP4 files (#34)
  • 0.15.0 (2016/08/06): fixed decoding of UTF-16LE ID3v2 Tags, improved overall stability
  • 0.14.0 (2016/06/05): MP4/M4A and Opus support

tinytag's People

Contributors

devsnd avatar shoghicp avatar tilboerner avatar egbertw avatar evandrolg avatar glogiotatidis avatar sampas avatar rizumu avatar minus7 avatar

Stargazers

Eva avatar Eren avatar

Watchers

James Cloos avatar  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.