# load_config.py
config = Config.from_path("settings.yaml")
fixed_config = Config()
fixed_config.merge(config, context=CaseNormalizer(normalize=str.lower, warn=True)
# warns here about MAIN needing to be renamed to main
safely_usable_config = CaseSensitiveLookup(fixed_config)
def get_host(settings):
# legacy code, gets warning about MAIN and HOST
return settings.MAIN.HOST
get_host(safely_usable_config)
when migrating from other configuration systems, those sometimes are very lenient on how they deal with uppercase/lowercase/mixed case keys
it would be nice to be able to
example: