wrapper for ConfigParser allowing for simple get,set,delete calls to set options from files, env variables, etc
Project description
configlib
=========
simple python wrapper for .conf file get, set, delete operations.
Use thusly:
.conf file:
```
[options]
somesetting=aDifferentValue
```
python code:
```
from configlib import getConfig,OptionParser
def initConfig():
#initialize config options
#sets defaults or overrides from config file.
options.something=getConfig('somesetting','defaultvalue',options.configfile)
if __name__ == "__main__":
parser=OptionParser()
parser.add_option("-c", dest='configfile' , default='', help="configuration file to use")
(options,args) = parser.parse_args()
initConfig()
```
pip install configlib
=========
simple python wrapper for .conf file get, set, delete operations.
Use thusly:
.conf file:
```
[options]
somesetting=aDifferentValue
```
python code:
```
from configlib import getConfig,OptionParser
def initConfig():
#initialize config options
#sets defaults or overrides from config file.
options.something=getConfig('somesetting','defaultvalue',options.configfile)
if __name__ == "__main__":
parser=OptionParser()
parser.add_option("-c", dest='configfile' , default='', help="configuration file to use")
(options,args) = parser.parse_args()
initConfig()
```
pip install configlib
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
configlib-2.0.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for configlib-2.0.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d80b79912409cc03e19392ec91c1b6a8b2ad44b9b1e7d1cdd452231a764cfc |
|
MD5 | 6eca387f7ee75eb332bda2d58ab702fb |
|
BLAKE2b-256 | 89a80362d019acb2683891869c1fa7fcd75a3b9ddc7faaf0f7f79d58fcc0c1b4 |