opennem.settings package


opennem.settings.log module

exception opennem.settings.log.SettingsNotFound

Bases: Exception

opennem.settings.log.load_logging_config(filename: str = 'logging.yml', fail_silent: bool = True)Optional[dict]

opennem.settings.schema module

class opennem.settings.schema.OpennemSettings(_env_file: Optional[Union[pathlib.Path, str]] = '<object object>', _env_file_encoding: Optional[str] = None, _secrets_dir: Optional[Union[pathlib.Path, str]] = None, *, env: str = 'development', endpoint: str = None, log_level: str = 'DEBUG', requests_cache_path: str = '.requests', precision_default: int = 4, db_debug: bool = False, http_timeout: int = 30, http_retries: int = 5, http_cache_local: bool = False)

Bases: pydantic.env_settings.BaseSettings

OpenNEMSettings Schema


BaseSettings ([type]) – Pydantic base settings


Exception – [description]



Return type


class Config

Bases: object

fields = {'endpoint': {'env': 'OPENNEM_API_ENDPOINT'}, 'env': {'env': 'OPENNEM_ENV'}, 'log_level': {'env': 'OPENMEM_LOG_LEVEL'}}
db_debug: bool
property debug
endpoint: Optional[str]
env: str
http_cache_local: bool
http_retries: int
http_timeout: int
log_level: str
precision_default: int
requests_cache_path: str
classmethod validate_log_level(log_value: str)Optional[str]

opennem.settings.utils module

opennem.settings.utils.load_env_file(environment: Optional[str])List[str]

Returns a list of env files to load

Module contents

Settings files - read settings from env

will read in order:

  • .env

  • .env.{environment}

  • system env

  • pydantic settings