toktokkie package¶
Subpackages¶
- toktokkie.commands package
- Submodules
- toktokkie.commands.AlbumArtFetchCommand module
- toktokkie.commands.AnimeThemeDlCommand module
- toktokkie.commands.ArchiveCommand module
- toktokkie.commands.Command module
- toktokkie.commands.IconizeCommand module
- toktokkie.commands.IdFetchCommand module
- toktokkie.commands.MangaCreateCommand module
- toktokkie.commands.MetadataAddCommand module
- toktokkie.commands.MetadataGenCommand module
- toktokkie.commands.MetadataValidateCommand module
- toktokkie.commands.MusicMergeCommand module
- toktokkie.commands.MusicTagCommand module
- toktokkie.commands.PlaylistCreateCommand module
- toktokkie.commands.PrintCommand module
- toktokkie.commands.RenameCommand module
- toktokkie.commands.SetComicCoverCommand module
- toktokkie.commands.SuperCutCommand module
- toktokkie.commands.UpdateCommand module
- toktokkie.commands.UrlOpenCommand module
- toktokkie.commands.YoutubeMusicDlCommand module
- Module contents
- toktokkie.metadata package
- Subpackages
- toktokkie.metadata.base package
- toktokkie.metadata.book package
- toktokkie.metadata.book_series package
- Subpackages
- Submodules
- toktokkie.metadata.book_series.BookSeries module
- toktokkie.metadata.book_series.BookSeriesExtras module
- toktokkie.metadata.book_series.BookSeriesPrompter module
- toktokkie.metadata.book_series.BookSeriesRenamer module
- toktokkie.metadata.book_series.BookSeriesValidator module
- Module contents
- toktokkie.metadata.comic package
- toktokkie.metadata.game package
- toktokkie.metadata.movie package
- toktokkie.metadata.music package
- toktokkie.metadata.tv package
- Module contents
- Subpackages
- toktokkie.test package
- Subpackages
- toktokkie.test.commands package
- Submodules
- toktokkie.test.commands.TestIconizeCommand module
- toktokkie.test.commands.TestIdFetchCommand module
- toktokkie.test.commands.TestMetadataAddCommand module
- toktokkie.test.commands.TestMetadataGenCommand module
- toktokkie.test.commands.TestMetadataValidateCommand module
- toktokkie.test.commands.TestMusicTagCommand module
- toktokkie.test.commands.TestPrintCommand module
- toktokkie.test.commands.TestRenameCommand module
- toktokkie.test.commands.TestYoutubeMusicDlCommand module
- Module contents
- toktokkie.test.metadata package
- toktokkie.test.utils package
- toktokkie.test.commands package
- Submodules
- toktokkie.test.TestDirectory module
- toktokkie.test.TestFramework module
- Module contents
- Subpackages
- toktokkie.utils package
Submodules¶
toktokkie.Directory module¶
-
class
toktokkie.Directory.
Directory
(path: str, no_validation: bool = False)¶ Bases:
object
Class that encapsulates all of toktokkie’s functionality
-
__init__
(path: str, no_validation: bool = False)¶ Initializes the metadata of the directory :param path: The directory’s path :param no_validation: Disables validation :except MissingMetadataException,
InvalidMetadataException, MetadataMismatch
-
static
create_metadata
(directory: str, media_type: Union[str, toktokkie.enums.MediaType]) → toktokkie.metadata.base.Metadata.Metadata¶ Generates a new metadata object using user prompts :param directory: The directory for which to generate the metadata :param media_type: The media type of the metadata :return: The generated metadata
-
static
get_metadata
(directory: str, no_validation: bool = False) → toktokkie.metadata.base.Metadata.Metadata¶ Automatically resolves the metadata of a directory :param directory: The directory for which to generate the metadata :param no_validation: Disables Validation :return: The generated metadata :raises InvalidMetadataException: If the metadata is invalid
-
static
get_metadata_class
(media_type: Union[str, toktokkie.enums.MediaType]) → Type[toktokkie.metadata.base.Metadata.Metadata]¶ Retrieves the metadata class for a given media type :param media_type: The media type for which to get the metadata class :return: The metadata class
-
classmethod
load_child_directories
(parent_dir: str, restrictions: Optional[List[toktokkie.enums.MediaType]] = None) → List[toktokkie.Directory.Directory]¶ Loads all media directories in a directory :param parent_dir: The directory to search for media directories :param restrictions: Restricts the found media directories to media
directories with a specific media type
- Returns
The list of Media Directories
-
classmethod
load_directories
(paths: List[str], restrictions: Optional[List[toktokkie.enums.MediaType]] = None) → List[toktokkie.Directory.Directory]¶ Loads the toktokkie Media Directory objects based on paths :param paths: The directories to turn into toktokkie Directory objs :param restrictions: Restricts the found media directories to media
directories with a specific media type
- Returns
The list of Media Directories
-
logger
= <Logger /usr/local/lib/python3.8/dist-packages/toktokkie-0.21.0-py3.8.egg/toktokkie/Directory.py (WARNING)>¶ Logger for the directory class
-
property
path
¶ - Returns
The path to the directory
-
classmethod
prompt
(path: str, metadata_type: Union[str, toktokkie.enums.MediaType]) → Optional[toktokkie.Directory.Directory]¶ Prompts the user for metadata information :param path: The path to the directory for which to prompt :param metadata_type: The metadata type to generate :return: The generated directory, or None if aborted
-
reload
()¶ Reloads the metadata from the metadata file :return: None
-
save
()¶ Updates the metadata file with the current contents of the metadata :return: None
-
toktokkie.enums module¶
-
class
toktokkie.enums.
IdType
(value)¶ Bases:
enum.Enum
Enumeration of all possible ID types
-
ANILIST
= 'anilist'¶
-
IMDB
= 'imdb'¶
-
ISBN
= 'isbn'¶
-
KITSU
= 'kitsu'¶
-
MANGADEX
= 'mangadex'¶
-
MUSICBRAINZ_ARTIST
= 'musicbrainz_artist'¶
-
MUSICBRAINZ_RECORDING
= 'musicbrainz_recording'¶
-
MUSICBRAINZ_RELEASE
= 'musicbrainz_release'¶
-
MYANIMELIST
= 'myanimelist'¶
-
TVDB
= 'tvdb'¶
-
VNDB
= 'vndb'¶
-
YOUTUBE_VIDEO
= 'youtube'¶
-
toktokkie.exceptions module¶
-
exception
toktokkie.exceptions.
InvalidDirectoryState
¶ Bases:
Exception
Exception that is raised if a directory is in a state that does not comply with requirements of a Metadata class
-
exception
toktokkie.exceptions.
InvalidMetadata
(reason: str)¶ Bases:
Exception
Exception that is raised whenever metadata is invalid
-
__init__
(reason: str)¶ - Parameters
reason – The reason why the metadata is invalid
-
-
exception
toktokkie.exceptions.
InvalidUpdateInstructions
¶ Bases:
Exception
Exception that is raised whenever xdcc update instructions are invalid
-
exception
toktokkie.exceptions.
MetadataMismatch
¶ Bases:
Exception
Exception that is raised whenever the metadata type in the JSON data is in conflict with the actual metadata class
-
exception
toktokkie.exceptions.
MissingMetadata
¶ Bases:
Exception
Exception that is raised whenever metadata is not found
-
exception
toktokkie.exceptions.
MissingUpdateInstructions
¶ Bases:
Exception
Exception that is raised whenever xdcc update instructions don’t exist