Configuration Loader

Module used for loading and storing configuration options

Exposed Functions

srcalchemy.config.parseConfig(configIO: BinaryIO) → ConfigSpec[source]

Parse Configuration Options from Binary I/O

Parameters:

configIO – Readable Binary I/O Object

Returns:

Configuration Specification parsed from

Internal Functions

srcalchemy.config.config_load.parseGeneralConfig(data: dict) → generalConfig[source]

Parse General Configuration from Dictionary

Parameters:

data – Dictionary to parse

Returns:

General Configuration

srcalchemy.config.config_load.parseKodiConfig(data: dict) → kodiConfig[source]

Parse Kodi Config from Dictionary

Parameters:

data – Dictionary to parse

Returns:

Kodi Configuration

srcalchemy.config.config_load.parseMovieConfig(data: dict) → movieConfig[source]

Parse Movie Configuration from Dictionary

Parameters:

data – Dictionary to parse

Returns:

Movie Configuration

srcalchemy.config.config_load.parseTvConfig(data: dict) → tvConfig[source]

Parse TV configuration from Dictionary

Parameters:

data – Dictionary to parse

Returns:

TV Configuration

srcalchemy.config.config_load.parseDriveMappingConfig(data: dict) → driveMappingConfig[source]

Parse Drive Mapping configuration from Dictionary

Parameters:

data – Dictionary to parse

Returns:

Drive mapping configuration

Data Classes

Data classes used to store configuration options

class srcalchemy.config.ConfigSpec(general: generalConfig = <factory>, log: Logger = <Logger srcalchemy.config.config_load (INFO)>, kodi: kodiConfig = <factory>, movie_config: movieConfig = <factory>, tv_config: tvConfig = <factory>, driveMapping: list[driveMappingConfig] = <factory>)[source]

Configurations Options

driveMapping: list[driveMappingConfig]

List of Drive mapping configurations

general: generalConfig

General configuration options

kodi: kodiConfig

Kodi configuration options

log: Logger = <Logger srcalchemy.config.config_load (INFO)>

Application Logger

movie_config: movieConfig

Movie configuration options

tv_config: tvConfig

TV configuration options

class srcalchemy.config.generalConfig(logFile: str = 'srcalchemy.log', dataDirectory: str = 'data', mode: Literal['copy', 'move'] = 'copy')[source]

General configuration options

dataDirectory: str = 'data'

Directory to output collected information to

logFile: str = 'srcalchemy.log'

Log file location

mode: Literal['copy', 'move'] = 'copy'

Mode of operation

Choice of:
  • copy: Copy media items when processing

  • move: Move media items when processing

class srcalchemy.config.kodiConfig(host: str = 'localhost', host_port: int = 8080, use_https: bool = False, ignore_ssl: bool = True)[source]

Kodi configuration options Used when interacting with the Kodi JSONRPC

host: str = 'localhost'

Hostname of IP address of Kodi host to connect to

host_port: int = 8080

Kodi JSONRPC port

ignore_ssl: bool = True

Ignore SSL when connecting to Kodi host

use_https: bool = False

Use HTTPS when connecting to Kodi host

class srcalchemy.config.movieConfig(basePath: str = '', outputDirectory: str | None = None, parentFormat: str = '{TITLE} ({YEAR})', fileFormat: str = '{TITLE} [{FORMAT}] ({YEAR})')[source]

Movie Configuration Used for processing parsed movies

basePath: str = ''

Base path of Movie Directory as defined in the Kodi Video Library

fileFormat: str = '{TITLE} [{FORMAT}] ({YEAR})'

Format map string for generating the output filename

outputDirectory: str | None = None

Optional Output directory

parentFormat: str = '{TITLE} ({YEAR})'

Format map string for generating the output directory name

class srcalchemy.config.tvConfig(basePath: str = '', outputDirectory: str | None = None, parentFormat: str = '{TITLE}', seasonFormat: str = 'Season {SEASON}', fileFormat: str = '{SHOW_TITLE} S{SEASON:02}E{EPISODE:02}')[source]

TV Configuration Used for processing parsed TV and Episodes

basePath: str = ''

Base path of TV Directory as defined in the Kodi Video Library

fileFormat: str = '{SHOW_TITLE} S{SEASON:02}E{EPISODE:02}'

Format map string for generating the output filename

outputDirectory: str | None = None
parentFormat: str = '{TITLE}'

Format map string for generating the output directory name

seasonFormat: str = 'Season {SEASON}'

Format map string for generating the season output directory name

class srcalchemy.config.driveMappingConfig(src: str, dest: str)[source]

Drive Mapping Configuration Used for replacing path strings for local mappings

dest: str

Destination path

src: str

Source Path string to be replace