Skip to content

climate_ref_core.env #

Environment variable management

get_env() #

Get the current environment

Returns:

Type Description
Env

The current environment including any environment variables loaded from the .env file and any defaults set by this application.

Source code in packages/climate-ref-core/src/climate_ref_core/env.py
def get_env() -> Env:
    """
    Get the current environment

    Returns
    -------
    :
        The current environment including any environment variables loaded from the .env file
        and any defaults set by this application.
    """
    # Set the default values for the environment variables
    _set_defaults()

    env = Env(expand_vars=True)

    # Load the environment variables from the .env file
    # This will override any defaults set above
    env.read_env(verbose=True)

    return env