Skip to main content

Python Configurations

Project description

ConfigIt is MIT Licensed Python Configuration library brought to you by the camera shy people at Pictage.

Python is all about the dicts so why do we settle for INIs?


All configuration files are native python files.

Using ConfigIt you can read those files in as a module, or file and return a dictionary with attribute access.

One of the most powerful things about configit is its ability to use other configurations within a configuration.


To install configit, simply:

$ pip install configit

API Documentation

Reads a string file path and returns a ConfigDict.
filepath = r'tests/configs/'

config = conf_from_file(filepath)
assert == 'default'
Reads an imported module and returns a ConfigDict.
import tests.configs.module_config

config = conf_from_module(tests.configs.module_config)
assert == 'module_config'

Reads a dictionary and returns a ConfigDict.

ConfigDicts are accessible by attributes as well as keys.

config = dict(answer=42)

config = configit.conf_from_dict(config)
assert config.answer == 42

Within a python configuration you can import another python configuration. The imported configuration will update local name space of the importing configuration. This means values in sub configuration will be accessible in the local configuration.

This can be useful for boiler plate configurations where you only need a few items changed. contents:

answer=42 contents:

import configit

Code using configit to get the configuration:

import configit
config = conf_from_file('')

assert config.answer == 42

Order matters! contents:

answer=42 contents:

import configit

Code using configit to get the configuration:

import configit
config = conf_from_file('')

assert config.answer == 5

For further examples refer to included tests.


  1. Fork the repository on Github to start making your changes to the develop branch (or branch off of it).

  2. Install to your env or venv by running:

    $ python develop
  3. Hack-a-thon, dance party!

  4. Write a test which shows that the bug was fixed or that the feature works as expected.

  5. Test by running:

    $ python test
  6. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS.

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 ConfigIt, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size ConfigIt-1.1.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page