Skip to content

Config

cl_forge.settings.Config

Config(dotenv_path: str | None = None)

Configuration container for library settings.

Notes
  • Tokens are loaded from environment variables or a .env file. System environment variables take precedence over .env file values.
  • If dotenv_path is provided, it loads the .env file from that path. Otherwise, it looks for a .env file in the current or parent directories.
  • Environment variables used:
    • CLFORGE_CMF_TOKEN: CMF token (API key).
    • CLFORGE_MARKET_TOKEN: Market token (ticket).

If dotenv_path is provided, it loads the .env file from that path. Otherwise, it looks for a .env file in the current or parent directories.

Parameters:

Name Type Description Default
dotenv_path str | None

Optional path to a .env file for loading tokens.

None
Source code in src/cl_forge/core/impl/rs_cl_forge/rs_base.pyi
def __init__(self, dotenv_path: str | None = None) -> None:
    """
    Initializes a new Config instance.

    If ``dotenv_path`` is provided, it loads the .env file from that path.
    Otherwise, it looks for a .env file in the current or parent directories.

    Parameters
    ----------
    dotenv_path : str | None
        Optional path to a .env file for loading tokens.
    """

tokens property

tokens: Token

Returns the loaded API tokens.