Package tagger :: Module id3v2 :: Class ID3v2
[show private | hide private]
[frames | no frames]

Class ID3v2


ID3v2 Tag Parser/Writer for MP3 files

Note:

tag has the following options

size = size of the whole header, excluding header and footer ext = has extension header (2.3, 2.4 only) exp = is experimental (2.4, 2.3 only) footer = has footer (2.3, 2.4 only) compression = has compression enabled (2.2 only) unsync = uses unsynchronise method of encoding data

To Do:

Method Summary
  __init__(self, filename, mode, version)
  commit(self, pretend)
  construct_ext_header(self)
Construct an Extension Header (FIXME)
  construct_footer(self)
Construct a Footer (FIXME)
  construct_header(self, size)
Construct Header Bytestring to for tag
  dump_header(self)
Debugging purposes, dump the whole header of the file.
  get_next_frame(self, search_length)
  new_frame(self, fid, frame)
Return a new frame of the correct type for this tag
  new_header(self, version)
Create a new default ID3v2 tag data structure
  parse_ext_header(self)
Parse Extension Header
  parse_footer(self)
Parse Footer
  parse_frames(self)
Recursively Parse Frames
  parse_header(self)
Parse Header of the file
  set_version(self, version)

Instance Variable Summary
dictionary of ID3v2*Frame(s) frames: list of frames that is in the tag
dictionary tag: dictionary of parameters that the tag has
float (2.2, 2.3, 2.4) version: version this tag supports

Class Variable Summary
list supported: list of version that this parser supports

Method Details

__init__(self, filename, mode=0, version=2.3999999999999999)
(Constructor)

Parameters:
filename - the file to open or write to.
           (type=string)
mode - either ID3_FILE_NEW, ID3_FILE_READ, ID3_FILE_MODIFY. The default is ID3_FILE_READ.
           (type=int)
version - if ID3_FILE_NEW, then what version to create the header in. Default is 2.4
           (type=float)
Raises:
ID3Exception - if file does not have an ID3v2 but is specified to be in read or modify mode.

construct_ext_header(self)

Construct an Extension Header (FIXME)

construct_footer(self)

Construct a Footer (FIXME)

construct_header(self, size)

Construct Header Bytestring to for tag
Parameters:
size - size to encode into the bytestring. Note the size is the whole size of the tag minus the header and footer
           (type=int)

dump_header(self)

Debugging purposes, dump the whole header of the file.

To Do: dump footer and extension header as well

new_frame(self, fid=None, frame=None)

Return a new frame of the correct type for this tag
Parameters:
fid - frame id
frame - bytes in the frame

new_header(self, version=2.3999999999999999)

Create a new default ID3v2 tag data structure
Parameters:
version - version of the tag to use. default is 2.4.
           (type=float)

parse_ext_header(self)

Parse Extension Header

parse_footer(self)

Parse Footer

To Do: implement me

parse_frames(self)

Recursively Parse Frames

parse_header(self)

Parse Header of the file

Instance Variable Details

frames

list of frames that is in the tag
Type:
dictionary of ID3v2*Frame(s)

tag

dictionary of parameters that the tag has
Type:
dictionary

version

version this tag supports
Type:
float (2.2, 2.3, 2.4)

Class Variable Details

supported

list of version that this parser supports
Type:
list
Value:
[2.2000000000000002, 2.2999999999999998, 2.3999999999999999]           

Generated by Epydoc 2.0 on Sun Apr 10 14:44:00 2005 http://epydoc.sf.net