Very opinionated configuration loading package for Python projects
Project description
Confuk
This is yet another package for managing configuration files in Python projects.
At the moment all it does is it exposes a consistent API that lets you provide a path to a TOML configuration file. It parses the config file into a dictionary by default. If a config class is provided when parsing, the class instance will be created using a dictionary of keyword arguments coming from the original TOML file.
In human words: I made this package so that I don't have to explicilty load, parse and return a class instance every single time I have something to do with a TOML file:
from confuk import parse_config
from pathlib import Path
from somewhere import ConfigClass
cfg_dict = parse_config(Path("some.toml")) # returns a dictionary
cfg_obj = parse_config(Path("some.toml"), ConfigClass) # returns an instance of `ConfigClass`
Installation
Currently you can build the package using Poetry:
- Clone this repo.
- Run
poetry build
. - Grab the installable wheel from the
dist
folder and install it withpip
or add the package as a local dependency of another project.
Once I get some time to take care of it I will add the package to PyPI so that it's installable via a simple pip install confuk
command.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.