Skip to main content

Configuration for humans

Project description

Latest Version Downloads Wheel Status

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.

https://op9bww.bn1302.livefilestore.com/y2phzX-gFw3yMuwMkL1HBwG23d-RWirCBlliDJ1dwR2VNPAG3Dp6LFJwpvnE3sPmr7-8V8HfC11mOsH-h7TAa1rzDHo0uuCks3PbTL7fM3PfGU/figs.jpg?psid=1

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

Project details


Download files

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

Source Distribution

configs-3.0.3.zip (8.0 kB view hashes)

Uploaded Source

Built Distributions

configs-3.0.3.win-amd64.exe (230.0 kB view hashes)

Uploaded Source

configs-3.0.3-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page