class splatnet3_scraper.query.QueryHandler

The QueryHandler class is the main class of the splatnet3_scraper.query module. It abstracts away the underlying implementation details of making queries to the SplatNet 3 API and makes it extremely easy to use. Token management is also handled by the QueryHandler so the user does not have to worry about having to regenerate tokens when they expire. The only exception to this is the session token, which the user must handle themselves as it is not possible to regenerate it automatically. The QueryHandler class is initialized with a Config class, which contains all the configuration options that the user can set. The QueryHandler class also contains multiple factory methods to create a new instance of the class to make it setting up the Config class much easier. The primary mode of operating the class is through the query method, which takes a query name and a dictionary of arguments and returns a QueryResponse object.

Constructors

QueryHandler(config)

Initializes the class, it is not meant to be instantiated directly, but rather through one of the available factory methods. Still, it can be instantiated directly if the user wants to use a custom Config class.

Methods

classmethod from_config_file(config_path=None, *, prefix='')

Creates a new instance of the class using a configuration file.

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

Creates a new instance of the class from an s3s configuration file.

classmethod from_session_token(session_token, *, prefix='')

Creates a new instance of the class using a session token.

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

Creates a new instance of the class using the tokens provided.

classmethod new_instance(*, prefix='')

Creates a new instance of the class.

query(query_name, language=None, variables={})

Queries Splatnet 3 and returns the data.

query_hash(query_hash, language=None, variables={})

Given a query hash, it will query SplatNet 3 and return the response.

raw_query(query_name, language=None, variables={})

Makes a raw query to the SplatNet 3 API.

raw_query_hash(query_hash, language=None, variables={})

Makes a raw query to the SplatNet 3 API using the query hash.