Skip to main content

Another Python configuration tool

Project description

Cool Config

Simple way to use configuration files with Python configuration model.

Usage

Simple usage example:

from cool_config import *


class Config(AbstractConfig):
    """
    Configuration model inherits from AbstractConfig, and all configuration sections from Section
    """
    class main(Section):
        a = Integer

    b = Integer


config = Config()  # global cpnfiguration object


if __name__ == '__main__':
    config_data = {
        'main': {
            'a': 5
        },
        'b': 42
    }

    config.load_from_dict(config_data) # initialize configuration from dict 
    # config.load('config.yml')  # or initialize configuration with config.yml

    print(config.main.a)  #  5
    print(config.b)  # 42

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

cool_config-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

cool_config-0.1.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page