wrapper for ConfigParser allowing for simple get calls to set options.
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
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.2.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for configlib-2.0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf242896b26f01692937b5175f30b246adc6d2a48255fe0f920bb3643487a064 |
|
MD5 | 562699ab58f91e4be17600d8e57e0a28 |
|
BLAKE2b-256 | 1618ab204ef73749299c48c7cd42a36bb3432a9f90e490b116ef653170aba4f1 |