class splatnet3_scraper.query.Config

The Config class is used to load, store, and manage the configuration options for the QueryHandler class. The Config class has a number of static methods that are used to create a new instance of the class, including from a file, from a few default options, etc. The bulk of the configuration options are stored in a ConfigParser object for uniformity and ease of use. It also functions as a high-level wrapper around the TokenManager class that enables the QueryHandler class to be quickly and easily instantiated, leading to less time spent configuring the QueryHandler class and more time spent making queries.

Public members

DEFAULT_CONFIG_PATH = '.splatnet3_scraper'
DEFAULT_PREFIX = 'SN3S'

Constructors

Config(handler, *, token_manager=None, output_file_path=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

static from_config_handler(handler, output_file_path=None)

Creates a Config object from a ConfigOptionHandler object.

static from_dict(config, prefix='')

Creates a Config object from a dictionary.

static from_empty_handler(prefix='')

Creates a Config object from an empty ConfigOptionHandler object. This is useful if you have environment variables set and want to create a Config object from them.

static from_file(file_path, save_to_file=True, prefix='')

Creates a Config object from a file.

static from_s3s_config(path, *, prefix='')

Creates a Config object from an s3s config file. This method is useful if you already have an s3s config file and want to use it to create a Config object. It is not recommended to use this method if you can avoid it.

static from_tokens(session_token, gtoken=None, ...)

Creates a Config object from a session token and other tokens.

get_value(option, default=None)

Gets the value of the option.

regenerate_tokens()

Regenerates the tokens and updates the config.

save_to_file(file_path=None)

Saves the config to a file.

set_value(option, value)

Sets the value of the option.

Properties

property bullet_token : str

The bullet token.

property gtoken : str

The gtoken.

property session_token : str

The session token.

property token_manager : TokenManager

The TokenManager object used to manage the tokens. Acts as a TypeGuard for the _token_manager attribute.

property tokens : dict[str, str]

The tokens.