This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Introduction

econf make it easy to define config options and reference them. The options can be provided through command line or config file.

Install

$ pip install http://github.com/wangst321/econf.git

How to Use

define options

First, import econf

from econf import *

For default options, that belong to ‘default’ section:

from econf import BaseConf

class DefaultConf(BaseConf):
    host = StrOpt(default='0.0.0.0', cmdline=True,
                  help='ip address')
    port = IntOpt(default=9090, cmdline=True,
                  help='tcp port')

For options belong to other section:

class ZKConf(BaseConf):
    __section__ = 'zk'

    hosts = StrOpt(
        required=True,
        help='list of zookeeper ip:port pair. i.e. localhost:2181')
    max_retry = IntOpt(
        default=3,
        help='number of tries before giving up connecting')

use options in your code

There are two ways to reference an option. First, use the specific Conf Class:

host, port = DefaultConf.host, DefaultConf.port

Second, use the general CONF:

host, port = CONF.host, CONF.port
zk_hosts = CONF.zk.hosts

parse cli options and config file

Note

When the code executes, this step should always be in front of those statements, which reference options.

If a default config is supplied:

from econf import CONF
CONF('path/to/your/default.conf')

or,

from econf import CONF
CONF()

Usually, this code is executed just before your service gonna start.

def run():
    from econf import CONF
    CONF()

    my_service.init(CONF.host, CONF.port, ...)
    my_service.start()
Release History

Release History

0.1.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
econf-0.1.4.tar.gz (5.4 kB) Copy SHA256 Checksum SHA256 Source Dec 18, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting