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.