Configuration¶
Configuration for API access
-
class
runeq.config.
Config
(*args, **kwargs)¶ Config holds configuration (e.g. auth credentials, URLs, etc)
-
__init__
(*args, **kwargs)¶ Initialize configuration options.
- Parameters
*args – Accepts at most 1; a filename. If provided, values will be loaded from the file, using load_yaml(). It is invalid to provide both a filename and keyword arguments.
**kwargs – Passed to set_values().
Examples
There are three valid ways to create a config:
>>> cfg = Config() # Load from default file location (~/.rune/config)
>>> cfg = Config('./example_config.yaml') # Load from a specified YAML file
>>> cfg = Config(client_key_id='foo', client_access_key='bar') # Set values using keyword arguments
-
property
auth_headers
¶ Authentication headers for HTTP requests.
-
load_yaml
(filename='~/.rune/config')¶ Set values from a YAML file. Keys from the file are passed directly to set_values(), as kwargs.
- Parameters
filename – File path for a YAML-formatted config file
-
set_values
(auth_method=None, access_token_id=None, access_token_secret=None, client_key_id=None, client_access_key=None, jwt=None, stream_url=None, **kwargs)¶ Set configuration values.
- Parameters
auth_method – One of ‘access_token’ or ‘client_keys’ or ‘jwt’.
falsy, the auth (If) –
is inferred based on which kwargs are specified. (method) –
access_token_id – User access token ID
access_token_secret – User access token secret
client_key_id – Client key ID
client_access_key – Client access key
jwt – JWT
stream_url – base URL to use for the stream API
-