nolito.settings module

class nolito.settings.NolitoSettings(client_id, client_secret, redirect_uri, api_base_url, keyring_service, keyring_username, metadata_file, request_timeout_seconds=30.0)[source]

Bases: object

Configuration for the Nolito client

The information between parenthesis shows the environment variable for this setting and its default value when applicable. This is only used when initializing through NolitoSettings.from_env(). Otherwise all attributes are required.

Parameters:
  • client_id (str) – Client ID for the Nolio API (NOLIO_CLIENT_ID)

  • client_secret (str) – Client secret for the Nolio API (NOLIO_CLIENT_SECRET)

  • redirect_uri (str) – Nolio redirect URI (NOLIO_REDIRECT_URI, defaults to http://127.0.0.1:8765/callback)

  • api_base_url (str) – Base URL for the API (NOLIO_API_BASE_URL, defaults to https://www.nolio.io/api/)

  • keyring_service (str) – Name of the keyring service (NOLITO_KEYRING_SERVICE, defaults to "nolito")

  • keyring_username (str) – Keyring username (NOLITO_KEYRING_USERNAME, defaults to "oauth_tokens")

  • metadata_file (Path) – Nolito metadata file, defaults to $XDG_CONFIG_HOME/nolito/tokens.metadata.json

  • request_timeout_seconds (float) – Timeout for web requests, defaults to 30 sec.

classmethod from_env()[source]

Initialize settings from environment variables.

See the class docs for details on each environment variable.

Return type:

NolitoSettings