Configuration Sourcesο
Confii supports loading configuration from multiple sources.
File Loadersο
Load from YAML, JSON, TOML, INI, or .env files:
from confii.loaders import YamlLoader, JsonLoader, TomlLoader
config = Config(loaders=[
YamlLoader("config.yaml"),
JsonLoader("config.json"),
TomlLoader("config.toml"),
])
Environment Variablesο
Load from environment variables with prefix:
from confii.loaders import EnvironmentLoader
config = Config(loaders=[
EnvironmentLoader("APP", separator="__")
])
Cloud Storageο
Load from AWS S3, Azure Blob Storage, or Google Cloud Storage:
from confii.loaders import S3Loader
config = Config(loaders=[
S3Loader("s3://my-bucket/config.yaml")
])
Remote URLsο
Load from HTTP/HTTPS endpoints:
from confii.loaders import HTTPLoader
config = Config(loaders=[
HTTPLoader("https://api.example.com/config.yaml")
])
For more details, see the Loaders documentation.