Configuration for humans
Project description
Parsing INI configs must be easy, as are INI files.
Configs provides a simple API for getting data from INI config files.
Loading data from a config is as easy as configs.load(my.conf).
Configs work with both Python 2 and 3.
See the full documentation at configs.rtfd.org.
The repo is at bitbucket.org/moigagoo/configs.
Features
Root-level params (with no section)
Numeric values are converted automatically
Sections with only key-value items are parsed as dicts
Sections with only flag items (keys with no value) are parsed as lists
Mixed content sections are parsed as a dict and a list, which can be accessed individually
Sections are iterable (even the mixed ones)
Installation
Install configs with pip:
% pip install configs
Basic usage
Load a config file:
>>> import configs >>> c = configs.load('sample.conf') >>> c['general'] {'foo': 'baz'}
Load a config file with a fallback config file (with default values):
>>> fc = configs.load('sample.conf', fallback_file='default.conf') >>> fc['general']['spam'] eggs
Read the full documentation at configs.rtfd.org.
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.