Metadata-Version: 1.0
Name: choices
Version: 0.4.0
Summary: Library to manage software configuration.
Home-page: https://github.com/kiip/choices
Author: Kiip
Author-email: biz@kiip.me
License: UNKNOWN
Description: Choices
        =======
        
        Choices is a library for configuring software. With choices, you use a
        standard API to define and read your configuration, while the actual
        setting of the configuration can come from a variety of sources such
        as files, command line, ZooKeeper, etc.
        
        Choices is meant to be a drop-in configuration library for any Python
        project, allowing libraries and applications to abstract away configuration.
        
        Usage
        -----
        
        Define some configuration options::
        
            from choices import Choices
        
            c = Choices()
            c.define("port", type=int, help="Port to listen on.")
            c.define("listen", type=str, help="Interface to listen on.")
        
        Then create a configuration loader and parse the options::
        
            from choices import FileLoader
        
            c.add_loader(FileLoader("/etc/myconfig.conf"))
            options = c.load()
        
            print("Listening on %s:%s" % (options.listen, options.port))
        
        The order of loaders added will define precedence. That is, loaders
        seen later will override values earlier if they are set.
        
        Environments
        ------------
        
        All built-in loaders have the notion of "environments" which are
        so critical to any large systems. Configuration in development is
        often different than in staging which is also different than production
        and so on. In the example given above, environments can easily be used::
        
            # Load production settings...
            options = c.load(environment="production")
        
            # Load staging settings...
            options = c.load(environment="staging")
        
            # etc.
        
        Each loader handles the ``environment`` option differently, so please
        look at the documentation for more information. As an example, however,
        the ``FileLoader`` will prefix the filename with the environment and a
        period, so ``myconfig.conf`` turns into ``production.myconfig.conf`` and
        so on.
        
Keywords: configuration,config,options
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
