Skip to main content

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.

Files for configlib, version 2.0.4
Filename, size File type Python version Upload date Hashes
Filename, size configlib-2.0.4-py3-none-any.whl (8.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size configlib-2.0.4.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page