- 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
TokenManagerclass that enables theQueryHandlerclass to be quickly and easily instantiated, leading to less time spent configuring theQueryHandlerclass 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
Configobject from aConfigOptionHandlerobject.
-
static from_empty_handler(prefix=
'') Creates a
Configobject from an emptyConfigOptionHandlerobject. This is useful if you have environment variables set and want to create aConfigobject from them.
-
static from_file(file_path, save_to_file=
True, prefix='') Creates a
Configobject from a file.
-
static from_s3s_config(path, *, prefix=
'') Creates a
Configobject from an s3s config file. This method is useful if you already have an s3s config file and want to use it to create aConfigobject. It is not recommended to use this method if you can avoid it.
-
static from_tokens(session_token, gtoken=
None, ...) Creates a
Configobject from a session token and other tokens.
- regenerate_tokens()
Regenerates the tokens and updates the config.
-
save_to_file(file_path=
None) Saves the config to a file.
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
TokenManagerobject used to manage the tokens. Acts as a TypeGuard for the_token_managerattribute.
- property tokens : dict[str, str]
The tokens.
-
DEFAULT_CONFIG_PATH =