eyed3 package

Submodules

eyed3.core module

Basic core types and utilities.

class eyed3.core.ArtistOrigin(city: str, state: str, country: str)[source]

Bases: object

city: str = None
state: str = None
country: str = None
id3Encode()[source]
eyed3.core.load(path, tag_version=None)[source]

Loads the file identified by path and returns a concrete type of eyed3.core.AudioFile. If path is not a file an IOError is raised. None is returned when the file type (i.e. mime-type) is not recognized. The following AudioFile types are supported:

If tag_version is not None (the default) only a specific version of metadata is loaded. This value must be a version constant specific to the eventual format of the metadata.

class eyed3.core.AudioInfo[source]

Bases: object

A base container for common audio details.

time_secs = 0.0
size_bytes = 0
class eyed3.core.Tag(title=None, artist=None, album=None, album_artist=None, track_num=None)[source]

Bases: object

An abstract interface for audio tag (meta) data (e.g. artist, title, etc.)

read_only = False
property title
property artist
property album
property album_artist
property track_num

Track number property. Must return a 2-tuple of (track-number, total-number-of-tracks). Either tuple value may be None.

class eyed3.core.AudioFile(path)[source]

Bases: object

Abstract base class for audio file types (AudioInfo + Tag)

Construct with a path and invoke _read. All other members are set to None.

rename(name, fsencoding='utf-8', preserve_file_time=False)[source]

Rename the file to name. The encoding used for the file name is eyed3.LOCAL_FS_ENCODING unless overridden by fsencoding. Note, if the target file already exists, or the full path contains non-existent directories the operation will fail with IOError. File times are not modified when preserve_file_time is True, False is the default.

property info

Returns a concrete implemenation of eyed3.core.AudioInfo

property tag

Returns a concrete implemenation of eyed3.core.Tag

property path

The absolute path of this file.

class eyed3.core.Date(year, month=None, day=None, hour=None, minute=None, second=None)[source]

Bases: object

A class for representing a date and time (optional). This class differs from datetime.datetime in that the default values for month, day, hour, minute, and second is None and not ‘January 1, 00:00:00’. This allows for an object that is simply 1987, and not January 1 12AM, for example. But when more resolution is required those vales can be set as well.

TIME_STAMP_FORMATS = ['%Y', '%Y-%m', '%Y-%m-%d', '%Y-%m-%dT%H', '%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%HZ', '%Y-%m-%dT%H:%MZ', '%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%d %H:%M:%S', '%Y-00-00', '%Y%m%d']

Valid time stamp formats per ISO 8601 and used by strptime.

property year
property month
property day
property hour
property minute
property second
static parse(s)[source]

Parses date strings that conform to ISO-8601.

eyed3.core.parseError(ex)[source]

A function that is invoked when non-fatal parse, format, etc. errors occur. In most cases the invalid values will be ignored or possibly fixed. This function simply logs the error.

eyed3.main module

eyed3.main.main(args, config)[source]
eyed3.main.profileMain(args, config)[source]

This is the main function for profiling http://code.google.com/appengine/kb/commontasks.html#profiling

eyed3.main.setFileScannerOpts(arg_parser, default_recursive=False, paths_metavar='PATH', paths_help='Files or directory paths')[source]
eyed3.main.makeCmdLineParser(subparser=None)[source]
eyed3.main.parseCommandLine(cmd_line_args=None)[source]

eyed3.mimetype module

eyed3.mimetype.guessMimetype(filename)[source]

Return the mime-type for filename.

class eyed3.mimetype.Mp2x[source]

Bases: filetype.types.base.Type

Implements the MP2.x audio type matcher.

MIME = 'audio/mpeg'
EXTENSION = 'mp3'
match(buf)[source]
class eyed3.mimetype.Mp3Invalids[source]

Bases: filetype.types.base.Type

Implements a MP3 audio type matcher this is odd or/corrupt mp3.

MIME = 'audio/mpeg'
EXTENSION = 'mp3'
match(buf)[source]
class eyed3.mimetype.Id3Tag[source]

Bases: filetype.types.base.Type

Implements a MP3 audio type matcher this is odd or/corrupt mp3.

MIME = 'application/x-id3'
EXTENSION = 'id3'
match(buf)[source]
class eyed3.mimetype.Id3TagExt[source]

Bases: eyed3.mimetype.Id3Tag

EXTENSION = 'tag'
class eyed3.mimetype.M3u[source]

Bases: filetype.types.base.Type

Implements the m3u playlist matcher.

MIME = 'audio/x-mpegurl'
EXTENSION = 'm3u'
match(buf)[source]

Module contents

exception eyed3.Error(*args)[source]

Bases: Exception

Base exception type for all eyed3 errors.

eyed3.load(path, tag_version=None)[source]

Loads the file identified by path and returns a concrete type of eyed3.core.AudioFile. If path is not a file an IOError is raised. None is returned when the file type (i.e. mime-type) is not recognized. The following AudioFile types are supported:

If tag_version is not None (the default) only a specific version of metadata is loaded. This value must be a version constant specific to the eventual format of the metadata.