skip to navigation
skip to content

configs 3.0.3

Configuration for humans

Package Documentation

Parsing INI configs must be easy, as are the 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 Python 2.7+ (including 3).

The repo is at bitbucket.org/moigagoo/configs.

Read the full documentation at configs.rtfd.org.

Features

  • Root-level params support
  • Numeric and boolean 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 tuples of a dict and a list, which can be accessed individually
  • Sections are iterable (even the mixed ones; list first, dict second)
  • Comments support

Installation

Install configs with pip:

$ pip install configs

Usage

Load a config file:

>>> import configs
>>> c = configs.load('sample.conf')
>>> c['general']
{'foo': 'baz'}

Tests

Run the tests with:

$ python test_configs.py
 
File Type Py Version Uploaded on Size
configs-3.0.3-py3-none-any.whl (md5) Python Wheel 3.4 2015-05-13 6KB
configs-3.0.3.win-amd64.exe (md5) MS Windows installer any 2015-05-13 224KB
configs-3.0.3.zip (md5) Source 2015-05-13 7KB