load_config¶
- geodetic_engine.projdb.load_config(*, config_file=None, env=None, load_dotenv_file=True, **overrides)[source]¶
Build a
ProjDbBuildConfigfrom 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
.envfile, 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_CONFIGis read, and thengeodetic-projdb.tomlin the working directory.env (
Mapping[str,str] |None, default:None) – Environment mapping. Defaults toos.environ.load_dotenv_file (
bool, default:True) – Load a.envfile into the environment first.**overrides (
Any) – Explicit values taking precedence over all other sources.
- Return type:
- 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'], ...)