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 | RSS feed
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 details)
File details
Details for the file pyerconf-0.1.0.tar.gz.
File metadata
- Download URL: pyerconf-0.1.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f724cd5b485ef540a0deac3a20e16cae134f8163d8ff31ff1599eaf23aacdf08
|
|
| MD5 |
b80f129e16998bfd35cce6df9967d682
|
|
| BLAKE2b-256 |
b6f0eea5a19a8d2d1ea462b03e6d85c27e3052f6b5c3b676a538fcf35dcceda5
|