Skip to main content

Python config management, but cute.

Project description


CircleCI PyPI Documentation Status

konfi lets you create config templates similar to dataclasses. These templates are then used to load the config from different sources. konfi guarantees that the loaded config corresponds to the template even going as far as making sure items of a list are of the right type.

This means you no longer have to worry about the validity of the config, if the config is correct it will load and if it isn't it will raise an error telling you why not.


You can install konfi from PyPI:

pip install konfi


from typing import Optional

import konfi

class UserInfo:
    name: str
    country: Optional[str]

class AppConfig:
    name: str = "konfi"
    user: UserInfo

    konfi.YAML("config.yml", ignore_not_found=True),

config = konfi.load(AppConfig)

greeting = f"Hello {}"
    greeting += f" from {}"

print(f"Welcome to {}!")

For more examples see the examples/ directory.


If you're ready to jump in, you can find the documentation on Read the Docs.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for konfi, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size konfi-0.2.1-py3-none-any.whl (23.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size konfi-0.2.1.tar.gz (17.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page