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.

Source Distribution

pyerconf-0.1.0.tar.gz (16.0 kB view hashes)

Uploaded Source

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