eyed3.plugins package

Submodules

eyed3.plugins.art module

class eyed3.plugins.art.ArtFile(file_path)[source]

Bases: object

image_data
mime_type
class eyed3.plugins.art.ArtPlugin(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

SUMMARY = u'Art for albums, artists, etc.'
DESCRIPTION = u''
NAMES = ['art']
start(args, config)[source]
handleDirectory(d, _)[source]
handleDone()[source]
eyed3.plugins.art.pilImage(source)[source]
eyed3.plugins.art.pilImageDetails(img)[source]
eyed3.plugins.art.md5Data(data)[source]
eyed3.plugins.art.md5File(file_name)[source]

Compute md5 hash for contents of file_name.

eyed3.plugins.classic module

class eyed3.plugins.classic.ClassicPlugin(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

SUMMARY = u'Classic eyeD3 interface for viewing and editing tags.'
DESCRIPTION = u'\nAll PATH arguments are parsed and displayed. Directory paths are searched\nrecursively. Any editing options (--artist, --title) are applied to each file\nread.\n\nAll date options (-Y, --release-year excepted) follow ISO 8601 format. This is\n``yyyy-mm-ddThh:mm:ss``. The year is required, and each component thereafter is\noptional. For example, 2012-03 is valid, 2012--12 is not.\n'
NAMES = ['classic']
handleFile(f)[source]
printHeader(file_path)[source]
printAudioInfo(info)[source]
printTag(tag)[source]
handleRemoves(tag)[source]
handlePadding(tag)[source]
handleEdits(tag)[source]

eyed3.plugins.fixup module

class eyed3.plugins.fixup.FixupPlugin(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

DESCRIPTION = u'\nOperates on directories at a time, fixing each as a unit (album,\ncompilation, live set, etc.). All of these should have common dates,\nfor example but other characteristics may vary. The ``--type`` should be used\nwhenever possible, ``lp`` is the default.\n\nThe following test and fixes always apply:\n\n 1. Every file will be given an ID3 tag if one is missing.\n 2. Set ID3 v2.4.\n 3. Set a consistent album name for all files in the directory.\n 4. Set a consistent artist name for all files, unless the type is\n ``various`` in which case the artist may vary (but must exist).\n 5. Ensure each file has a title.\n 6. Ensure each file has a track # and track total.\n 7. Ensure all files have a release and original release date, unless the\n type is ``live`` in which case the recording date is set.\n 8. All ID3 frames of the following types are removed: USER, PRIV\n 9. All ID3 files have TLEN (track length in ms) set (or updated).\n 10. The album/dir type is set in the tag. Types of ``lp`` and ``various``\n do not have this field set since the latter is the default and the\n former can be determined during sync. In ID3 terms the value is in\n TXXX (description: ``eyeD3#album_type``).\n 11. Files are renamed as follows:\n - Type ``various``: ${track:num} - ${artist} - ${title}\n - Type ``single``: ${artist} - ${title}\n - All other types: ${artist} - ${track:num} - ${title}\n - A rename template can be supplied in --file-rename-pattern\n 12. Directories are renamed as follows:\n - Type ``live``: ${best_date:prefer_recording} - ${album}\n - All other types: ${best_date:prefer_release} - ${album}\n - A rename template can be supplied in --dir-rename-pattern\n\nAlbum types:\n\n - ``lp``: A traditinal "album" of songs from a single artist.\n No extra info is written to the tag since this is the default.\n - ``ep``: A short collection of songs from a single artist. The string \'ep\'\n is written to the tag\'s ``eyeD3#album_type`` field.\n - ``various``: A collection of songs from different artists. The string\n \'various\' is written to the tag\'s ``eyeD3#album_type`` field.\n - ``live``: A collection of live recordings from a single artist. The string\n \'live\' is written to the tag\'s ``eyeD3#album_type`` field.\n - ``compilation``: A collection of songs from various recordings by a single\n artist. The string \'compilation\' is written to the tag\'s\n ``eyeD3#album_type`` field. Compilation dates, unlike other types, may\n differ.\n - ``demo``: A demo recording by a single artist. The string \'demo\' is\n written to the tag\'s ``eyeD3#album_type`` field.\n - ``single``: A track that should no be associated with an album (even if\n it has album metadata). The string \'single\' is written to the tag\'s\n ``eyeD3#album_type`` field.\n\n'
NAMES = ['fixup']
SUMMARY = 'Performs various checks and fixes to directories of audio files.'
handleDirectory(directory, _)[source]
handleDone()[source]
handleFile(f, *args, **kwargs)[source]
start(args, config)[source]
eyed3.plugins.fixup.dirDate(d)[source]

eyed3.plugins.genres module

class eyed3.plugins.genres.GenreListPlugin(arg_parser)[source]

Bases: eyed3.plugins.Plugin

SUMMARY = u'Display the full list of standard ID3 genres.'
DESCRIPTION = u'ID3 v1 defined a list of genres and mapped them to to numeric values so they can be stored as a single byte. It is *recommended* that these genres are used although most newer software (including eyeD3) does not care.'
NAMES = ['genres']
start(args, config)[source]

eyed3.plugins.itunes module

class eyed3.plugins.itunes.Podcast(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

NAMES = ['itunes-podcast']
SUMMARY = u'Adds (or removes) the tags necessary for Apple iTunes to identify the file as a podcast.'
handleFile(f)[source]

eyed3.plugins.lameinfo module

class eyed3.plugins.lameinfo.LameInfoPlugin(arg_parser, cache_files=False, track_images=False)[source]

Bases: eyed3.plugins.LoaderPlugin

Constructor. If cache_files is True (off by default) then each AudioFile is appended to _file_cache during handleFile and the list is cleared by handleDirectory.

NAMES = ['lameinfo', 'xing']
SUMMARY = u'Outputs lame header (if one exists) for file.'
DESCRIPTION = u"The 'lame' (or xing) header provides extra information about the mp3 that is useful to players and encoders but not officially part of the mp3 specification. Variable bit rate mp3s, for example, use this header.\n\nFor more details see `here <http://gabriel.mp3-tech.org/mp3infotag.html>`_"
printHeader(filePath)[source]
handleFile(f)[source]

eyed3.plugins.nfo module

class eyed3.plugins.nfo.NfoPlugin(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

NAMES = ['nfo']
SUMMARY = u'Create NFO files for each directory scanned.'
DESCRIPTION = u'Each directory scanned is treated as an album and a `NFO <http://en.wikipedia.org/wiki/.nfo>`_ file is written to standard out.\n\nNFO files are often found in music archives.'
handleFile(f)[source]
handleDone()[source]

eyed3.plugins.pymod module

class eyed3.plugins.pymod.PyModulePlugin(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

SUMMARY = u'Imports a Python module file and calls its functions for the the various plugin events.'
DESCRIPTION = u"\nIf no module if provided (see -m/--module) a file named eyeD3mod.py in\nthe current working directory is imported. If any of the following methods\nexist they still be invoked:\n\ndef audioFile(audio_file):\n '''Invoked for every audio file that is encountered. The ``audio_file``\n is of type ``eyed3.core.AudioFile``; currently this is the concrete type\n ``eyed3.mp3.Mp3AudioFile``.'''\n pass\n\ndef audioDir(d, audio_files, images):\n '''This function is invoked for any directory (``d``) that contains audio\n (``audio_files``) or image (``images``) media.'''\n pass\n\ndef done():\n '''This method is invoke before successful exit.'''\n pass\n"
NAMES = ['pymod']
start(args, config)[source]
handleFile(f)[source]
handleDirectory(d, _)[source]
handleDone()[source]

eyed3.plugins.statistics module

class eyed3.plugins.statistics.Rule[source]

Bases: object

test()[source]
class eyed3.plugins.statistics.Id3TagRules[source]

Bases: eyed3.plugins.statistics.Rule

test(path, audio_file)[source]
class eyed3.plugins.statistics.BitrateRule[source]

Bases: eyed3.plugins.statistics.Rule

test(path, audio_file)[source]
class eyed3.plugins.statistics.FileRule[source]

Bases: eyed3.plugins.statistics.Rule

test(path, audio_file)[source]
class eyed3.plugins.statistics.ArtworkRule[source]

Bases: eyed3.plugins.statistics.Rule

test(path, audio_file)[source]
class eyed3.plugins.statistics.Id3FrameRules[source]

Bases: eyed3.plugins.statistics.Rule

test(path, audio_file)[source]
class eyed3.plugins.statistics.Stat(*args, **kwargs)[source]

Bases: collections.Counter

TOTAL = 'total'
compute(file, audio_file)[source]
report()[source]
percent(key)[source]
class eyed3.plugins.statistics.AudioStat(*args, **kwargs)[source]

Bases: eyed3.plugins.statistics.Stat

compute(audio_file)[source]
class eyed3.plugins.statistics.FileCounterStat[source]

Bases: eyed3.plugins.statistics.Stat

SUPPORTED_AUDIO = 'audio'
UNSUPPORTED_AUDIO = 'audio (unsupported)'
HIDDEN_FILES = 'hidden'
OTHER_FILES = 'other'
class eyed3.plugins.statistics.MimeTypeStat(*args, **kwargs)[source]

Bases: eyed3.plugins.statistics.Stat

class eyed3.plugins.statistics.Id3VersionCounter[source]

Bases: eyed3.plugins.statistics.AudioStat

class eyed3.plugins.statistics.Id3FrameCounter(*args, **kwargs)[source]

Bases: eyed3.plugins.statistics.AudioStat

class eyed3.plugins.statistics.BitrateCounter[source]

Bases: eyed3.plugins.statistics.AudioStat

class eyed3.plugins.statistics.RuleViolationStat(*args, **kwargs)[source]

Bases: eyed3.plugins.statistics.Stat

class eyed3.plugins.statistics.Id3ImageTypeCounter[source]

Bases: eyed3.plugins.statistics.AudioStat

class eyed3.plugins.statistics.StatisticsPlugin(arg_parser)[source]

Bases: eyed3.plugins.LoaderPlugin

NAMES = ['stats']
SUMMARY = u'Computes statistics for all audio files scanned.'
handleFile(path)[source]
handleDone()[source]

eyed3.plugins.xep_118 module

class eyed3.plugins.xep_118.Xep118Plugin(arg_parser, cache_files=False, track_images=False)[source]

Bases: eyed3.plugins.LoaderPlugin

Constructor. If cache_files is True (off by default) then each AudioFile is appended to _file_cache during handleFile and the list is cleared by handleDirectory.

NAMES = ['xep-118']
SUMMARY = u'Outputs all tags in XEP-118 XML format. (see: http://xmpp.org/extensions/xep-0118.html)'
handleFile(f)[source]
getXML(audio_file)[source]

Module contents

eyed3.plugins.load(name=None, reload=False, paths=None)[source]

Returns the eyed3.plugins.Plugin class identified by name. If name is None then the full list of plugins is returned. Once a plugin is loaded its class object is cached, and future calls to this function will returned the cached version. Use reload=True to refresh the cache.

class eyed3.plugins.Plugin(arg_parser)[source]

Bases: eyed3.utils.FileHandler

Base class for all eyeD3 plugins

SUMMARY = u'eyeD3 plugin'

One line about the plugin

DESCRIPTION = u''

Detailed info about the plugin

NAMES = []

A list of at least one name for invoking the plugin, values [1:] are treated as alias

start(args, config)[source]

Called after command line parsing but before any paths are processed. The self.args argument (the parsed command line) and self.config (the user config, if any) is set here.

handleFile(f)[source]
handleDone()[source]

Called after all file/directory processing; before program exit. The return value is passed to sys.exit (None results in 0).

class eyed3.plugins.LoaderPlugin(arg_parser, cache_files=False, track_images=False)[source]

Bases: eyed3.plugins.Plugin

A base class that provides auto loading of audio files

Constructor. If cache_files is True (off by default) then each AudioFile is appended to _file_cache during handleFile and the list is cleared by handleDirectory.

handleFile(f, *args, **kwargs)[source]

Loads f and sets self.audio_file to an instance of eyed3.core.AudioFile or None if an error occurred or the file is not a recognized type.

The *args and **kwargs are passed to eyed3.core.load().

handleDirectory(d, _)[source]

Override to make use of self._file_cache. By default the list is cleared, subclasses should consider doing the same otherwise every AudioFile will be cached.

handleDone()[source]

If no audio files were loaded this simply prints “Nothing to do”.