nyx_client.configuration

SDK configuration classes.

Classes

BaseNyxConfig

Configuration for the Nyx client.

ConfigType

Nyx configuration types.

NyxConfigExtended

Extended configuration for Nyx client with API integration.

Module Contents

class nyx_client.configuration.BaseNyxConfig

Configuration for the Nyx client.

nyx_url: str

The URL of the Nyx instance.

nyx_password: str

The email of the Nyx user.

nyx_email: str

The password of the Nyx user.

override_token: str | None = None

Allows injection of JWT token

classmethod from_env(env_file='.env', override_token=None)

Create a BaseNyxConfig instance from environment variables.

Parameters:
  • env_file (str) – Relative (to the working directory) or absolute path to the environment file.

  • override_token (str | None) – Token to override the default authentication.

Returns:

A new BaseNyxConfig instance.

Raises:

ValueError – If a required variable is not set in the env file or the file does not exist.

__str__()

Return a string representation of the configuration.

Returns:

A JSON string of the configuration.

property nyx_auth: dict

Get the authentication credentials.

Returns:

A dictionary containing email and password for authentication.

Return type:

dict

class nyx_client.configuration.ConfigType

Bases: str, enum.Enum

Nyx configuration types.

class nyx_client.configuration.NyxConfigExtended

Extended configuration for Nyx client with API integration.

api_key: str

The API key for the selected provider.

provider: ConfigType

The type of configuration provider.

base_config: BaseNyxConfig

The base Nyx configuration.

classmethod from_env(provider, env_file='.env', override_token=None)

Create a NyxConfigExtended instance from environment variables.

Parameters:
  • provider (ConfigType) – The type of configuration provider.

  • env_file (str) – Relative (to the working directory) or absolute path to the environment file.

  • override_token (str | None) – Token to override the default authentication.

Returns:

A new NyxConfigExtended instance.

Raises:

ValueError – If a required variable is not set in the env file, the env file does not exist or the corresponding api_key env var is not set.