1
0
Fork
You've already forked basicconfigparser
1
A basic configuration file parser module for Python.
  • Python 100%
Find a file
2024年12月26日 23:05:24 +01:00
.gitignore first commit 2020年05月07日 15:11:18 +02:00
basicconfigparser.py commit 2020年05月07日 16:08:23 +02:00
LICENSE first commit 2020年05月07日 15:11:18 +02:00
README first commit 2020年05月07日 15:11:18 +02:00
setup.py updated author's email 2024年12月26日 23:05:24 +01:00

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, '=', '#')
"