You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 years ago | |
---|---|---|
.gitignore | 2 years ago | |
LICENSE | 2 years ago | |
README | 2 years ago | |
basicconfigparser.py | 2 years ago | |
setup.py | 2 years ago |
README
A basic configuration file parser module for Python. Is's GPL3 licensed.
It is a simple function which takes a file path a dictionary of rules
(regex based) an optional key value separator (default is '='), an optional
character to identify lines which start with a comment (default '#'),
and returns a dictionary containing parsed data.
No sections or others things are required.
The eventually rised exceptions contain error line number.
Usage example:
"
import basicconfigparser
rules = {'min': r'[1-3][0-9]',
'max': r'/.*?'}
data = basicconfigparser.parse('/path/to/test/config', rules, '=', '#')
"