Use pydantic settings to load from environment? https://docs.pydantic.dev/latest/concepts/pydantic_settings/ Alternatively could load a dictionary from a python settings file? (eg django) Bear in mind will want to support multiple databases.