mymeco package

Subpackages

Submodules

mymeco.cmdline module

Command line support for mymeco.

mymeco.cmdline.mymecoctl(argv=None)[source]

Entrypoint to create nfo file next to video file.

mymeco.config module

Handle application configuration file.

class mymeco.config.Configuration(configfile=None)[source]

Bases: object

Handle configuration file.

property configfile: str

Get configuration file found.

Returns:

Full path of found configuration file where data are extracted.

log()[source]

Get logger configuration.

Read configuration file and extract right configuration for logger, ready to be passed to mymeco.logger.configure function.

Return type:

Mapping[str, Union[int, bool]]

Returns:

Ready to use kwargs for mymeco.logger.configure method.

tmdb()[source]

Get TMDb configuration.

Read configuration file and extract The Movie Database configuration.

Return type:

Mapping[str, str]

Returns:

Configuration map to access TMDb service. Output contains at least the following keys: * token: access token

Raises:

MissingConfiguration exception is raised when configuration entry is missing.

mymeco.exceptions module

Top Level exceptions module raised by Mymeco.

exception mymeco.exceptions.MissingConfiguration(section, key, filename)[source]

Bases: MymecoError

Raise when a necessary configuration entry is not found.

>>> MissingConfiguration('section', 'key', 'file')
MissingConfiguration: [section].key is not found in file
exception mymeco.exceptions.MymecoError(message)[source]

Bases: BaseException

All exception raised by Mymeco should inherit this base class.

>>> MymecoError('Generic Error')
MymecoError: Generic Error
>>> print(MymecoError('Unexpected behaviour'))
Unexpected behaviour
exception mymeco.exceptions.NoConfigurationFile[source]

Bases: MymecoError

Raise when no configuration file is available.

>>> NoConfigurationFile()
NoConfigurationFile: No configuration file was found on your system.

mymeco.logger module

Logging utility module.

Module aims to configure logging (verbosity, format, etc…)

mymeco.logger.configure(verbosity_count=0, quiet_count=0, colored=True)[source]

Configure main logger according to given verbosity configuration.

Parameters:
  • verbosity_count (int) – Set number of -v command line switch.

  • quiet_count (int) – Set number of -q command line switch.

  • colored (bool) – Define if log output should be colored or not.

Return type:

None

Default is to set verbosity on INFO level

Module contents

Mymeco base module.