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


Download files

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

Files for pyerconf, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pyerconf-0.1.0.tar.gz (16.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page