Skip to main content

Pythonic Hierarchical Configuration parser

Project description

Sample config:

# a value is set with: key : value
# values are typed. allowed types are:
#  - string (simple or double quotes)
#  - boolean (True or False. is case sensitive)
#  - integer

strval : 'this is a string'
boolval: True
intval : 142

# you can define hierarchies with dictionaries
# ! no comma to se
orgchart : {
    boss : 'Mr Goldmine'

    head_office : {
        VP  : 'Miz dho'
        CTO : 'John Bugs'
    }
}

Loaded from python:

>>> import pyerconf
>>> cfg = pyerconf.Config('./sample.cfg')
>>> print cfg.strval
this is a string
>>> print cfg.orgchart.boss
Mr Goldmine
>>> print cfg.orgchart.head_office
{'VP': 'Miz dho', 'CTO': 'John Bugs'}

>>> print cfg.foobar
AttributeError

Project details


Release history Release notifications

This version
History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pyerconf-0.1.0.tar.gz (16.0 kB) Copy SHA256 hash SHA256 Source None Oct 27, 2011

Supported by

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