id3 Package

id3 Package

eyed3.id3.ID3_V1 = (1, None, None)

Version 1, 1.0 or 1.1

eyed3.id3.ID3_V1_0 = (1, 0, 0)

Version 1.0, specifically

eyed3.id3.ID3_V1_1 = (1, 1, 0)

Version 1.1, specifically

eyed3.id3.ID3_V2 = (2, None, None)

Version 2, 2.2, 2.3 or 2.4

eyed3.id3.ID3_V2_2 = (2, 2, 0)

Version 2.2, specifically

eyed3.id3.ID3_V2_3 = (2, 3, 0)

Version 2.3, specifically

eyed3.id3.ID3_V2_4 = (2, 4, 0)

Version 2.4, specifically

eyed3.id3.ID3_DEFAULT_VERSION = (2, 4, 0)

The default version for eyeD3 tags and save operations.

eyed3.id3.ID3_ANY_VERSION = (3, None, None)

Useful for operations where any version will suffice.

eyed3.id3.LATIN1_ENCODING = '\x00'

Byte code for latin1

eyed3.id3.UTF_16_ENCODING = '\x01'

Byte code for UTF-16

eyed3.id3.UTF_16BE_ENCODING = '\x02'

Byte code for UTF-16 (big endian)

eyed3.id3.UTF_8_ENCODING = '\x03'

Byte code for UTF-8 (Not supported in ID3 versions < 2.4)

eyed3.id3.DEFAULT_LANG = 'eng'

Default language code for frames that contain a language portion.

eyed3.id3.isValidVersion(v, fully_qualified=False)[source]

Check the tuple v against the list of valid ID3 version constants. If fully_qualified is True it is enforced that there are 3 components to the version in v. Returns True when valid and False otherwise.

eyed3.id3.normalizeVersion(v)[source]

If version tuple v is of the non-specific type (v1 or v2, any, etc.) a fully qualified version is returned.

eyed3.id3.versionToString(v)[source]

Conversion version tuple v to a string description.

exception eyed3.id3.GenreException(*args)[source]

Bases: eyed3.Error

Excpetion type for exceptions related to genres.

class eyed3.id3.Genre(*args, **kwargs)[source]

Bases: object

A genre in terms of a name and and id. Only when name is a “standard” genre (as defined by ID3 v1) will id be a value other than None.

id[source]

The Genre’s id property. When setting the value is strictly enforced and if the value is not a valid genre code a ValueError is raised. Otherwise the id is set and the name property is updated to the code’s string name.

name[source]

The Genre’s name property. When setting the value the name is looked up in the standard genre map and if found the id ppropery is set to the numeric valud and the name is normalized to the sting found in the map. Non standard genres are set (with a warning log) and the id is set to None. It is valid to set the value to None.

static parse(*args, **kwargs)[source]
class eyed3.id3.GenreMap(*args)[source]

Bases: dict

Classic genres defined around ID3 v1 but suitable anywhere. This class is used primarily as a way to map numeric genre values to a string name. Genre strings on the other hand are not required to exist in this list.

The optional *args are passed directly to the dict constructor.

GENRE_MIN = 0
GENRE_MAX = 148
ID3_GENRE_MIN = 0
ID3_GENRE_MAX = 79
WINAMP_GENRE_MIN = 80
WINAMP_GENRE_MAX = 147
class eyed3.id3.TagFile(path, version=(3, None, None))[source]

Bases: eyed3.core.AudioFile

A shim class for dealing with files that contain only ID3 data, no audio.

initTag(version=(2, 4, 0))[source]

Add a id3.Tag to the file (removing any existing tag if one exists).

eyed3.id3.ID3_GENRES = [u'Blues', u'Classic Rock', u'Country', u'Dance', u'Disco', u'Funk', u'Grunge', u'Hip-Hop', u'Jazz', u'Metal', u'New Age', u'Oldies', u'Other', u'Pop', u'R&B', u'Rap', u'Reggae', u'Rock', u'Techno', u'Industrial', u'Alternative', u'Ska', u'Death Metal', u'Pranks', u'Soundtrack', u'Euro-Techno', u'Ambient', u'Trip-Hop', u'Vocal', u'Jazz+Funk', u'Fusion', u'Trance', u'Classical', u'Instrumental', u'Acid', u'House', u'Game', u'Sound Clip', u'Gospel', u'Noise', u'AlternRock', u'Bass', u'Soul', u'Punk', u'Space', u'Meditative', u'Instrumental Pop', u'Instrumental Rock', u'Ethnic', u'Gothic', u'Darkwave', u'Techno-Industrial', u'Electronic', u'Pop-Folk', u'Eurodance', u'Dream', u'Southern Rock', u'Comedy', u'Cult', u'Gangsta Rap', u'Top 40', u'Christian Rap', u'Pop / Funk', u'Jungle', u'Native American', u'Cabaret', u'New Wave', u'Psychedelic', u'Rave', u'Showtunes', u'Trailer', u'Lo-Fi', u'Tribal', u'Acid Punk', u'Acid Jazz', u'Polka', u'Retro', u'Musical', u'Rock & Roll', u'Hard Rock', u'Folk', u'Folk-Rock', u'National Folk', u'Swing', u'Fast Fusion', u'Bebob', u'Latin', u'Revival', u'Celtic', u'Bluegrass', u'Avantgarde', u'Gothic Rock', u'Progressive Rock', u'Psychedelic Rock', u'Symphonic Rock', u'Slow Rock', u'Big Band', u'Chorus', u'Easy Listening', u'Acoustic', u'Humour', u'Speech', u'Chanson', u'Opera', u'Chamber Music', u'Sonata', u'Symphony', u'Booty Bass', u'Primus', u'Porn Groove', u'Satire', u'Slow Jam', u'Club', u'Tango', u'Samba', u'Folklore', u'Ballad', u'Power Ballad', u'Rhythmic Soul', u'Freestyle', u'Duet', u'Punk Rock', u'Drum Solo', u'A Cappella', u'Euro-House', u'Dance Hall', u'Goa', u'Drum & Bass', u'Club-House', u'Hardcore', u'Terror', u'Indie', u'BritPop', u'Negerpunk', u'Polsk Punk', u'Beat', u'Christian Gangsta Rap', u'Heavy Metal', u'Black Metal', u'Crossover', u'Contemporary Christian', u'Christian Rock', u'Merengue', u'Salsa', u'Thrash Metal', u'Anime', u'JPop', u'Synthpop', u'Rock/Pop']

ID3 genres, as defined in ID3 v1. The position in the list is the genre’s numeric byte value.

eyed3.id3.genres = {0: u'Blues', 1: u'Classic Rock', 2: u'Country', 3: u'Dance', 4: u'Disco', 5: u'Funk', 6: u'Grunge', 7: u'Hip-Hop', u'dance': 3, 9: u'Metal', 10: u'New Age', 11: u'Oldies', 12: u'Other', 13: u'Pop', 14: u'R&B', 15: u'Rap', 16: u'Reggae', 17: u'Rock', 18: u'Techno', 19: u'Industrial', 20: u'Alternative', 21: u'Ska', 22: u'Death Metal', 23: u'Pranks', 24: u'Soundtrack', 25: u'Euro-Techno', 26: u'Ambient', 27: u'Trip-Hop', 28: u'Vocal', 29: u'Jazz+Funk', 30: u'Fusion', u'classic rock': 1, 32: u'Classical', 33: u'Instrumental', 34: u'Acid', 35: u'House', 36: u'Game', 37: u'Sound Clip', 38: u'Gospel', 39: u'Noise', 40: u'AlternRock', 41: u'Bass', 42: u'Soul', 43: u'Punk', 44: u'Space', 45: u'Meditative', 46: u'Instrumental Pop', 47: u'Instrumental Rock', 48: u'Ethnic', 8: u'Jazz', 50: u'Darkwave', 51: u'Techno-Industrial', 52: u'Electronic', 53: u'Pop-Folk', 54: u'Eurodance', 55: u'Dream', 56: u'Southern Rock', 57: u'Comedy', 58: u'Cult', 59: u'Gangsta Rap', 60: u'Top 40', 61: u'Christian Rap', 62: u'Pop / Funk', 63: u'Jungle', 64: u'Native American', 65: u'Cabaret', 66: u'New Wave', 67: u'Psychedelic', 68: u'Rave', u'contemporary christian': 140, 70: u'Trailer', 71: u'Lo-Fi', 72: u'Tribal', 73: u'Acid Punk', 74: u'Acid Jazz', 75: u'Polka', 76: u'Retro', 77: u'Musical', 78: u'Rock & Roll', 79: u'Hard Rock', 80: u'Folk', 81: u'Folk-Rock', 82: u'National Folk', 83: u'Swing', 84: u'Fast Fusion', 85: u'Bebob', 86: u'Latin', 87: u'Revival', 88: u'Celtic', 89: u'Bluegrass', 90: u'Avantgarde', 91: u'Gothic Rock', 92: u'Progressive Rock', 93: u'Psychedelic Rock', 94: u'Symphonic Rock', 95: u'Slow Rock', 96: u'Big Band', 97: u'Chorus', 98: u'Easy Listening', 99: u'Acoustic', 100: u'Humour', 101: u'Speech', 102: u'Chanson', 103: u'Opera', 104: u'Chamber Music', 105: u'Sonata', 106: u'Symphony', 107: u'Booty Bass', 108: u'Primus', 109: u'Porn Groove', 110: u'Satire', 111: u'Slow Jam', 112: u'Club', 113: u'Tango', 114: u'Samba', 115: u'Folklore', 116: u'Ballad', 117: u'Power Ballad', 118: u'Rhythmic Soul', 119: u'Freestyle', 120: u'Duet', 121: u'Punk Rock', 122: u'Drum Solo', 123: u'A Cappella', 124: u'Euro-House', 125: u'Dance Hall', 126: u'Goa', 127: u'Drum & Bass', 128: u'Club-House', 129: u'Hardcore', 130: u'Terror', 131: u'Indie', 132: u'BritPop', 133: u'Negerpunk', 134: u'Polsk Punk', 135: u'Beat', 136: u'Christian Gangsta Rap', 137: u'Heavy Metal', 138: u'Black Metal', u'heavy metal': 137, u'rhythmic soul': 118, 141: u'Christian Rock', 142: u'Merengue', 143: u'Salsa', 144: u'Thrash Metal', 145: u'Anime', 146: u'JPop', 147: u'Synthpop', 148: u'Rock/Pop', 149: u'<not-set>', 150: u'<not-set>', 151: u'<not-set>', 152: u'<not-set>', 153: u'<not-set>', 154: u'<not-set>', u'acid': 34, 156: u'<not-set>', 157: u'<not-set>', u'folk': 80, 159: u'<not-set>', 160: u'<not-set>', 161: u'<not-set>', 162: u'<not-set>', 163: u'<not-set>', 164: u'<not-set>', 165: u'<not-set>', 166: u'<not-set>', 167: u'<not-set>', 168: u'<not-set>', 169: u'<not-set>', 170: u'<not-set>', 171: u'<not-set>', 172: u'<not-set>', 173: u'<not-set>', 174: u'<not-set>', 175: u'<not-set>', 176: u'<not-set>', 177: u'<not-set>', 178: u'<not-set>', 179: u'<not-set>', u'porn groove': 109, 181: u'<not-set>', 182: u'<not-set>', 183: u'<not-set>', 184: u'<not-set>', 185: u'<not-set>', 186: u'<not-set>', 31: u'Trance', 188: u'<not-set>', 189: u'<not-set>', 190: u'<not-set>', 191: u'<not-set>', 192: u'<not-set>', 193: u'<not-set>', 194: u'<not-set>', 195: u'<not-set>', 196: u'<not-set>', 197: u'<not-set>', u'oldies': 11, 199: u'<not-set>', 200: u'<not-set>', 201: u'<not-set>', 202: u'<not-set>', 203: u'<not-set>', 204: u'<not-set>', 205: u'<not-set>', 206: u'<not-set>', 207: u'<not-set>', 208: u'<not-set>', 209: u'<not-set>', 210: u'<not-set>', 211: u'<not-set>', 212: u'<not-set>', 213: u'<not-set>', 214: u'<not-set>', 215: u'<not-set>', u'cult': 58, 217: u'<not-set>', 218: u'<not-set>', u'trip-hop': 27, 220: u'<not-set>', 221: u'<not-set>', 222: u'<not-set>', 223: u'<not-set>', 224: u'<not-set>', 225: u'<not-set>', 226: u'<not-set>', 227: u'<not-set>', 228: u'<not-set>', 229: u'<not-set>', 230: u'<not-set>', 231: u'<not-set>', 232: u'<not-set>', 233: u'<not-set>', 234: u'<not-set>', 235: u'<not-set>', 236: u'<not-set>', 237: u'<not-set>', 238: u'<not-set>', 239: u'<not-set>', 240: u'<not-set>', 241: u'<not-set>', 242: u'<not-set>', 243: u'<not-set>', 244: u'<not-set>', 245: u'<not-set>', 246: u'<not-set>', 247: u'<not-set>', 248: u'<not-set>', 249: u'<not-set>', 250: u'<not-set>', 251: u'<not-set>', 252: u'<not-set>', 253: u'<not-set>', 254: u'<not-set>', 255: u'<not-set>', u'humour': 100, 49: u'Gothic', u'dance hall': 125, u'symphony': 106, u'ballad': 116, u'freestyle': 119, u'instrumental': 33, u'terror': 130, u'soul': 42, u'indie': 131, u'club-house': 128, u'darkwave': 50, 69: u'Showtunes', u'bebob': 85, u'comedy': 57, u'punk rock': 121, u'drum solo': 122, u'soundtrack': 24, u'ethnic': 48, u'salsa': 143, u'psychedelic': 67, u'folk-rock': 81, u'jungle': 63, u'dream': 55, u'hip-hop': 7, u'chamber music': 104, u'slow rock': 95, u'sonata': 105, u'opera': 103, u'rock': 17, u'acoustic': 99, u'trailer': 70, u'house': 35, u'blues': 0, u'space': 44, u'goa': 126, u'bass': 41, u'alternrock': 40, u'techno': 18, u'tribal': 72, u'punk': 43, u'swing': 83, u'industrial': 19, u'hard rock': 79, u'electronic': 52, u'chanson': 102, u'revival': 87, u'tango': 113, u'acid jazz': 74, 139: u'Crossover', u'acid punk': 73, 140: u'Contemporary Christian', u'christian rock': 141, u'power ballad': 117, u'death metal': 22, u'vocal': 28, u'eurodance': 54, u'a cappella': 123, u'polsk punk': 134, u'christian rap': 61, u'crossover': 139, u'rap': 15, 155: u'<not-set>', u'trance': 31, 158: u'<not-set>', u'jpop': 146, u'slow jam': 111, u'metal': 9, u'rock/pop': 148, u'gothic rock': 91, u'black metal': 138, u'top 40': 60, 180: u'<not-set>', u'rock & roll': 78, u'beat': 135, u'jazz': 8, 187: u'<not-set>', u'disco': 4, u'gospel': 38, u'new wave': 66, 198: u'<not-set>', u'r&b': 14, u'instrumental rock': 47, u'meditative': 45, u'latin': 86, u'country': 2, u'primus': 108, u'pop': 13, 216: u'<not-set>', u'rave': 68, 219: u'<not-set>', u'satire': 110, u'sound clip': 37, u'folklore': 115, u'hardcore': 129, u'funk': 5, u'merengue': 142, u'bluegrass': 89, u'gothic': 49, u'ambient': 26, u'synthpop': 147, u'speech': 101, u'britpop': 132, u'<not-set>': 255, u'celtic': 88, u'euro-house': 124, u'musical': 77, u'alternative': 20, u'cabaret': 65, u'samba': 114, u'easy listening': 98, u'ska': 21, u'fusion': 30, u'big band': 96, u'national folk': 82, u'pranks': 23, u'chorus': 97, u'psychedelic rock': 93, u'pop / funk': 62, u'euro-techno': 25, u'classical': 32, u'progressive rock': 92, u'showtunes': 69, u'retro': 76, u'noise': 39, u'pop-folk': 53, u'gangsta rap': 59, u'christian gangsta rap': 136, u'avantgarde': 90, u'symphonic rock': 94, u'jazz+funk': 29, u'negerpunk': 133, u'booty bass': 107, u'anime': 145, u'polka': 75, u'thrash metal': 144, u'drum & bass': 127, u'fast fusion': 84, u'grunge': 6, u'game': 36, u'duet': 120, u'lo-fi': 71, u'instrumental pop': 46, u'southern rock': 56, u'techno-industrial': 51, u'new age': 10, u'club': 112, u'other': 12, u'reggae': 16, u'native american': 64}

A map of standard genre names and IDs per the ID3 v1 genre definition.

frames Module

exception eyed3.id3.frames.FrameException(*args)[source]

Bases: eyed3.Error

class eyed3.id3.frames.Frame(id)[source]

Bases: object

parse(data, frame_header)[source]
render()[source]
static decompress(data)[source]
static compress(data)[source]
static decrypt(data)[source]
static encrypt(data)[source]
text_delim[source]
class eyed3.id3.frames.TextFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.Frame

Text frames. Data string format: encoding (one byte) + text

text[source]
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.UserTextFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.TextFrame

description[source]
parse(data, frame_header)[source]

Data string format: encoding (one byte) + description + “” + text

render()[source]
class eyed3.id3.frames.DateFrame(id, date='')[source]

Bases: eyed3.id3.frames.TextFrame

parse(data, frame_header)[source]
date[source]
class eyed3.id3.frames.UrlFrame(id, url='')[source]

Bases: eyed3.id3.frames.Frame

url[source]
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.UserUrlFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.UrlFrame

Data string format: encoding (one byte) + description + “” + url (ascii)

description[source]
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.ImageFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.Frame

OTHER = 0
ICON = 1
OTHER_ICON = 2
FRONT_COVER = 3
BACK_COVER = 4
LEAFLET = 5
MEDIA = 6
LEAD_ARTIST = 7
ARTIST = 8
CONDUCTOR = 9
BAND = 10
COMPOSER = 11
LYRICIST = 12
RECORDING_LOCATION = 13
DURING_RECORDING = 14
DURING_PERFORMANCE = 15
VIDEO = 16
BRIGHT_COLORED_FISH = 17
ILLUSTRATION = 18
MIN_TYPE = 0
MAX_TYPE = 20
URL_MIME_TYPE = '-->'
description[source]
picture_type[source]
parse(data, frame_header)[source]
render()[source]
static picTypeToString(t)[source]
static stringToPicType(s)[source]
makeFileName(name=None)[source]
class eyed3.id3.frames.ObjectFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.Frame

description[source]
filename[source]
parse(data, frame_header)[source]

Parse the frame from data bytes using details from frame_header.

Data string format: <Header for ‘General encapsulated object’, ID: “GEOB”> Text encoding $xx MIME type <text string> $00 Filename <text string according to encoding> $00 (00) Content description <text string according to encoding> $00 (00) Encapsulated object <binary data>

render()[source]
class eyed3.id3.frames.PrivateFrame(id='PRIV', owner_id='', owner_data='')[source]

Bases: eyed3.id3.frames.Frame

PRIV

parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.MusicCDIdFrame(id='MCDI', toc='')[source]

Bases: eyed3.id3.frames.Frame

toc[source]
parse(data, frame_header)[source]
class eyed3.id3.frames.PlayCountFrame(id='PCNT', count=0)[source]

Bases: eyed3.id3.frames.Frame

parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.PopularityFrame(id='POPM', email='', rating=0, count=0)[source]

Bases: eyed3.id3.frames.Frame

Frame type for ‘POPM’ frames; popularity. Frame format: <Header for ‘Popularimeter’, ID: “POPM”> Email to user <text string> $00 Rating $xx Counter $xx xx xx xx (xx ...)

rating[source]
email[source]
count[source]
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.UniqueFileIDFrame(id='UFID', owner_id=None, uniq_id=None)[source]

Bases: eyed3.id3.frames.Frame

parse(data, frame_header)[source]

Data format Owner identifier <text string> $00 Identifier up to 64 bytes binary data>

render()[source]
class eyed3.id3.frames.DescriptionLangTextFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.Frame

description[source]
text[source]
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.CommentFrame(id='COMM', description=u'', lang='eng', text=u'')[source]

Bases: eyed3.id3.frames.DescriptionLangTextFrame

class eyed3.id3.frames.LyricsFrame(id='USLT', description=u'', lang='eng', text=u'')[source]

Bases: eyed3.id3.frames.DescriptionLangTextFrame

class eyed3.id3.frames.TermsOfUseFrame(*args, **kwargs)[source]

Bases: eyed3.id3.frames.Frame

text[source]
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.TocFrame(id='CTOC', element_id=None, toplevel=True, ordered=True, child_ids=None, description=None)[source]

Bases: eyed3.id3.frames.Frame

Table of content frame. There may be more than one, but only one may have the top-level flag set.

Data format: Element ID: <string>TOC flags: %000000ab Entry count: %xx Child elem IDs: <string>(... num entry count) Description: TIT2 frame (optional)

TOP_LEVEL_FLAG_BIT = 6
ORDERED_FLAG_BIT = 7
parse(data, frame_header)[source]
render()[source]
class eyed3.id3.frames.StartEndTuple

Bases: tuple

A 2-tuple, with names ‘start’ and ‘end’.

end

Alias for field number 1

start

Alias for field number 0

class eyed3.id3.frames.ChapterFrame(id='CHAP', element_id=None, times=None, offsets=None, sub_frames=None)[source]

Bases: eyed3.id3.frames.Frame

Frame type for chapter/section of the audio file. <ID3v2.3 or ID3v2.4 frame header, ID: “CHAP”> (10 bytes) Element ID <text string> $00 Start time $xx xx xx xx End time $xx xx xx xx Start offset $xx xx xx xx End offset $xx xx xx xx <Optional embedded sub-frames>

NO_OFFSET = 4294967295

No offset value, aka “0xff0xff0xff0xff”

parse(data, frame_header)[source]
render()[source]
title[source]
subtitle[source]
user_url[source]
class eyed3.id3.frames.FrameSet[source]

Bases: dict

parse(f, tag_header, extended_header)[source]

Read frames starting from the current read position of the file object. Returns the amount of padding which occurs after the tag, but before the audio content. A return valule of 0 does not mean error.

getAllFrames()[source]

Return all the frames in the set as a list. The list is sorted in an arbitrary but consistent order.

setTextFrame(*args, **kwargs)[source]
eyed3.id3.frames.deunsyncData(data)[source]
eyed3.id3.frames.createFrame(tag_header, frame_header, data)[source]
eyed3.id3.frames.decodeUnicode(bites, encoding)[source]
eyed3.id3.frames.splitUnicode(data, encoding)[source]
eyed3.id3.frames.id3EncodingToString(encoding)[source]
eyed3.id3.frames.stringToEncoding(s)[source]
eyed3.id3.frames.map2_2FrameId(orig_id)[source]

headers Module

class eyed3.id3.headers.TagHeader(version=(2, 4, 0))[source]

Bases: object

SIZE = 10
clear()[source]
version[source]
major_version[source]
minor_version[source]
rev_version[source]
parse(f)[source]

Parse an ID3 v2 header starting at the current position of f. If a header is parsed True is returned, otherwise False. If a header is found but malformed an eyed3.id3.tag.TagException is thrown.

render(tag_len=None)[source]
class eyed3.id3.headers.ExtendedTagHeader[source]

Bases: object

RESTRICT_TAG_SZ_LARGE = 0
RESTRICT_TAG_SZ_MED = 1
RESTRICT_TAG_SZ_SMALL = 2
RESTRICT_TAG_SZ_TINY = 3
RESTRICT_TEXT_ENC_NONE = 0
RESTRICT_TEXT_ENC_UTF8 = 1
RESTRICT_TEXT_LEN_NONE = 0
RESTRICT_TEXT_LEN_1024 = 1
RESTRICT_TEXT_LEN_128 = 2
RESTRICT_TEXT_LEN_30 = 3
RESTRICT_IMG_ENC_NONE = 0
RESTRICT_IMG_ENC_PNG_JPG = 1
RESTRICT_IMG_SZ_NONE = 0
RESTRICT_IMG_SZ_256 = 1
RESTRICT_IMG_SZ_64 = 2
RESTRICT_IMG_SZ_64_EXACT = 3
update_bit[source]
crc_bit[source]
crc[source]
restrictions_bit[source]
tag_size_restriction[source]
tag_size_restriction_description[source]
text_enc_restriction[source]
text_enc_restriction_description[source]
text_length_restriction[source]
text_length_restriction_description[source]
image_enc_restriction[source]
image_enc_restriction_description[source]
image_size_restriction[source]
image_size_restriction_description[source]
render(version, frame_data, padding=0)[source]
parse(fp, version)[source]

Parse an ID3 v2 extended header starting at the current position of fp and per the format defined by version. This method should only be called when the presence of an extended header is known since it moves the file position. If a header is found but malformed an eyed3.id3.tag.TagException is thrown. The return value is None.

class eyed3.id3.headers.FrameHeader(fid, version)[source]

Bases: object

TAG_ALTER = None
FILE_ALTER = None
READ_ONLY = None
COMPRESSED = None
ENCRYPTED = None
GROUPED = None
UNSYNC = None
DATA_LEN = None
copyFlags(rhs)[source]
major_version[source]
minor_version[source]
version[source]
tag_alter[source]
file_alter[source]
read_only[source]
compressed[source]
encrypted[source]
grouped[source]
unsync[source]
data_length_indicator[source]
render(data_size)[source]
static parse(f, version)[source]

tag Module

exception eyed3.id3.tag.TagException(*args)[source]

Bases: eyed3.Error

class eyed3.id3.tag.Tag[source]

Bases: eyed3.core.Tag

clear()[source]
parse(fileobj, version=(3, None, None))[source]
version[source]
isV1()[source]

Test ID3 major version for v1.x

isV2()[source]

Test ID3 major version for v2.x

setTextFrame(*args, **kwargs)[source]
getTextFrame(fid)[source]
comments[source]
bpm
play_count[source]
publisher
cd_id[source]
images[source]
encoding_date
best_release_date[source]

This method tries its best to return a date of some sort, amongst alll the possible date frames. The order of preference for a release date is 1) date of original release 2) date of this versions release 3) the recording date. Or None is returned.

getBestDate(prefer_recording_date=False)[source]

This method returns a date of some sort, amongst all the possible date frames. The order of preference is:

  1. date of original release
  2. date of this versions release
  3. the recording date.

Unless prefer_recording_date is True in which case the order is 3, 1, 2.

None will be returned if no dates are available.

release_date

The date the audio was released. This is NOT the original date the work was released, instead it is more like the pressing or version of the release. Original release date is usually what is intended but many programs use this frame and/or don’t distinguish between the two.

original_release_date

The date the work was originally released.

recording_date

The date of the recording. Many applications use this for release date regardless of the fact that this value is rarely known, and release dates are more correct.

tagging_date
lyrics[source]
disc_num[source]
objects[source]
privates[source]
popularities[source]
genre
user_text_frames[source]
commercial_url[source]
copyright_url[source]
audio_file_url[source]
audio_source_url[source]
artist_url[source]
internet_radio_url[source]
payment_url[source]
publisher_url[source]
user_url_frames[source]
unique_file_ids[source]
terms_of_use[source]
save(filename=None, version=None, encoding=None, backup=False, preserve_file_time=False, max_padding=None)[source]

Save the tag. If filename is not give the value from the file_info member is used, or a TagException is raised. The version argument can be used to select an ID3 version other than the version read. Select text encoding with ``encoding or use the existing (or default) encoding. If backup is True the orignal file is preserved; likewise if preserve_file_time is True the file´s modification/access times are not updated.

static remove(filename, version=(3, None, None))[source]
chapters[source]
table_of_contents[source]
album_type[source]
artist_origin[source]

Returns a 3-tuple: (city, state, country) Any may be None.

class eyed3.id3.tag.FileInfo(file_name)[source]

This class is for storing information about a parsed file. It containts info such as the filename, original tag size, and amount of padding; all of which can make rewriting faster.

initStatTimes()[source]
touch(times)[source]

times is a 2-tuple of (atime, mtime).

class eyed3.id3.tag.AccessorBase(fid, fs, match_func=None)[source]

Bases: object

get(*args, **kwargs)[source]
remove(*args, **kwargs)[source]

Returns the removed item or None if not found.

class eyed3.id3.tag.DltAccessor(FrameClass, fid, fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(*args, **kwargs)[source]
remove(*args, **kwargs)[source]
get(*args, **kwargs)[source]
class eyed3.id3.tag.CommentsAccessor(fs)[source]

Bases: eyed3.id3.tag.DltAccessor

class eyed3.id3.tag.LyricsAccessor(fs)[source]

Bases: eyed3.id3.tag.DltAccessor

class eyed3.id3.tag.ImagesAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(*args, **kwargs)[source]
remove(*args, **kwargs)[source]
get(*args, **kwargs)[source]
class eyed3.id3.tag.ObjectsAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(*args, **kwargs)[source]
remove(*args, **kwargs)[source]
get(*args, **kwargs)[source]
class eyed3.id3.tag.PrivatesAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(data, owner_id)[source]
remove(owner_id)[source]
get(owner_id)[source]
class eyed3.id3.tag.UserTextsAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(*args, **kwargs)[source]
remove(*args, **kwargs)[source]
get(*args, **kwargs)[source]
class eyed3.id3.tag.UniqueFileIdAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(data, owner_id)[source]
remove(owner_id)[source]
get(owner_id)[source]
class eyed3.id3.tag.UserUrlsAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(*args, **kwargs)[source]
remove(*args, **kwargs)[source]
get(*args, **kwargs)[source]
class eyed3.id3.tag.PopularitiesAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(email, rating, play_count)[source]
remove(email)[source]
get(email)[source]
class eyed3.id3.tag.ChaptersAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(element_id, times, offsets=(None, None), sub_frames=None)[source]
remove(element_id)[source]
get(element_id)[source]
class eyed3.id3.tag.TocAccessor(fs)[source]

Bases: eyed3.id3.tag.AccessorBase

set(*args, **kwargs)[source]
remove(element_id)[source]
get(element_id)[source]
class eyed3.id3.tag.TagTemplate(pattern, path_friendly=True, dotted_dates=False)[source]

Bases: string.Template

pattern = <_sre.SRE_Pattern object at 0x304e190>
idpattern = '[_a-z][_a-z0-9:]*'
substitute(tag, zeropad=True)[source]
safe_substitute(tag, zeropad=True)

Table Of Contents

Previous topic

eyed3 Package

Next topic

mp3 Package

This Page