load_config

geodetic_engine.projdb.load_config(*, config_file=None, env=None, load_dotenv_file=True, **overrides)[source]

Build a ProjDbBuildConfig from file, environment and overrides.

Non-secret settings belong in the config file, which is safe to version control. Credentials come from the environment or a gitignored .env file, and are rejected if they appear in the config file.

Parameters:
  • config_file (Path | None, default: None) – TOML file with a [projdb] table. When omitted, GEODETIC_ENGINE_CONFIG is read, and then geodetic-projdb.toml in the working directory.

  • env (Mapping[str, str] | None, default: None) – Environment mapping. Defaults to os.environ.

  • load_dotenv_file (bool, default: True) – Load a .env file into the environment first.

  • **overrides (Any) – Explicit values taking precedence over all other sources.

Return type:

ProjDbBuildConfig

Returns:

A validated configuration.

Raises:

ConfigurationError – If a required value is missing, a value is malformed, or the config file names a secret or an unknown setting.

Example

>>> load_config()
ProjDbBuildConfig(georepository=..., authorities=['Example'], ...)