eyed3.plugins package
Submodules
eyed3.plugins.art module
- class eyed3.plugins.art.ArtFile(file_path)[source]
Bases:
object
- property image_data
- property mime_type
- class eyed3.plugins.art.ArtPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- SUMMARY = 'Art for albums, artists, etc.'
- DESCRIPTION = ''
- NAMES = ['art']
- start(args, config)[source]
Called after command line parsing but before any paths are processed. The
self.args
argument (the parsed command line) andself.config
(the user config, if any) is set here.
eyed3.plugins.classic module
- class eyed3.plugins.classic.ClassicPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- SUMMARY = 'Classic eyeD3 interface for viewing and editing tags.'
- DESCRIPTION = '\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]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.extract module
- class eyed3.plugins.extract.ExtractPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['extract']
- SUMMARY = 'Extract tags from audio files.'
- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.fixup module
- class eyed3.plugins.fixup.FixupPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['fixup']
- SUMMARY = 'Performs various checks and fixes to directories of audio files.'
- DESCRIPTION = '\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'
- start(args, config)[source]
Called after command line parsing but before any paths are processed. The
self.args
argument (the parsed command line) andself.config
(the user config, if any) is set here.
- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.genres module
- class eyed3.plugins.genres.GenreListPlugin(arg_parser)[source]
Bases:
Plugin
- SUMMARY = 'Display the full list of standard ID3 genres.'
- DESCRIPTION = 'ID3 v1 defined a list of genres and mapped them to to numeric values so they can be stored as a single byte.\nIt is *recommended* that these genres are used although most newer software (including eyeD3) does not care.'
- NAMES = ['genres']
eyed3.plugins.itunes module
- class eyed3.plugins.itunes.Podcast(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['itunes-podcast']
- SUMMARY = 'Adds (or removes) the tags necessary for Apple iTunes to identify the file as a podcast.'
- handleFile(f)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.jsontag module
- class eyed3.plugins.jsontag.JsonTagPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['json']
- SUMMARY = 'Outputs all tags as JSON.'
- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.lameinfo module
- class eyed3.plugins.lameinfo.LameInfoPlugin(arg_parser, cache_files=False, track_images=False)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['lameinfo', 'xing']
- SUMMARY = 'Outputs lame header (if one exists) for file.'
- DESCRIPTION = "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>`_"
- handleFile(f, *_, **__)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.lastfm module
eyed3.plugins.mimetype module
- class eyed3.plugins.mimetype.MimetypesPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['mimetypes']
- start(args, config)[source]
Called after command line parsing but before any paths are processed. The
self.args
argument (the parsed command line) andself.config
(the user config, if any) is set here.
- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.nfo module
- class eyed3.plugins.nfo.NfoPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['nfo']
- SUMMARY = 'Create NFO files for each directory scanned.'
- DESCRIPTION = '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]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.pymod module
- class eyed3.plugins.pymod.PyModulePlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- SUMMARY = 'Imports a Python module file and calls its functions for the the various plugin events.'
- DESCRIPTION = '\nIf no module if provided a file named eyeD3mod.py in the current working directory is\nimported. If any of the following methods exist 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]
Called after command line parsing but before any paths are processed. The
self.args
argument (the parsed command line) andself.config
(the user config, if any) is set here.
- handleFile(f)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.stats module
- class eyed3.plugins.stats.BitrateRule[source]
Bases:
Rule
- BITRATE_DEDUCTIONS = [(128, -20), (192, -10)]
- class eyed3.plugins.stats.Stat(*args, **kwargs)[source]
Bases:
Counter
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- TOTAL = 'total'
- class eyed3.plugins.stats.AudioStat(*args, **kwargs)[source]
Bases:
Stat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.FileCounterStat[source]
Bases:
Stat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- SUPPORTED_AUDIO = 'audio'
- UNSUPPORTED_AUDIO = 'audio (unsupported)'
- HIDDEN_FILES = 'hidden'
- OTHER_FILES = 'other'
- class eyed3.plugins.stats.MimeTypeStat(*args, **kwargs)[source]
Bases:
Stat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.Id3VersionCounter[source]
Bases:
AudioStat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.Id3FrameCounter(*args, **kwargs)[source]
Bases:
AudioStat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.BitrateCounter[source]
Bases:
AudioStat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.RuleViolationStat(*args, **kwargs)[source]
Bases:
Stat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.Id3ImageTypeCounter[source]
Bases:
AudioStat
Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts.
>>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args
- class eyed3.plugins.stats.StatisticsPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['stats']
- SUMMARY = 'Computes statistics for all audio files scanned.'
- handleFile(path)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.xep_118 module
- class eyed3.plugins.xep_118.Xep118Plugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['xep-118']
- SUMMARY = 'Outputs all tags in XEP-118 XML format. (see: http://xmpp.org/extensions/xep-0118.html)'
- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
eyed3.plugins.yamltag module
- class eyed3.plugins.yamltag.YamlTagPlugin(arg_parser)[source]
Bases:
LoaderPlugin
Constructor. If
cache_files
is True (off by default) then each AudioFile is appended to_file_cache
duringhandleFile
and the list is cleared byhandleDirectory
.- NAMES = ['yaml']
- SUMMARY = 'Outputs all tags as YAML.'
- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.
Module contents
- eyed3.plugins.load(name=None, reload=False, paths=None)[source]
Returns the eyed3.plugins.Plugin class identified by
name
. Ifname
isNone
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. Usereload=True
to refresh the cache.
- class eyed3.plugins.Plugin(arg_parser)[source]
Bases:
FileHandler
Base class for all eyeD3 plugins
- SUMMARY = 'eyeD3 plugin'
- DESCRIPTION = ''
- NAMES = []
- start(args, config)[source]
Called after command line parsing but before any paths are processed. The
self.args
argument (the parsed command line) andself.config
(the user config, if any) is set here.
- class eyed3.plugins.LoaderPlugin(arg_parser, cache_files=False, track_images=False)[source]
Bases:
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
duringhandleFile
and the list is cleared byhandleDirectory
.- handleFile(f, *args, **kwargs)[source]
Loads
f
and setsself.audio_file
to an instance ofeyed3.core.AudioFile
orNone
if an error occurred or the file is not a recognized type.The
*args
and**kwargs
are passed toeyed3.core.load()
.