trading-ig icon indicating copy to clipboard operation
trading-ig copied to clipboard

Use JSON or YAML files for config

Open femtotrader opened this issue 9 years ago • 0 comments

It will be nice to use JSON or YAML files for config

but we still need config via environment variable (because of continuous integration with Travis-CI)

os.getenv(..., ...)

Maybe we should have a look at Traits / Traitlets http://traitlets.readthedocs.org/en/latest/config.html

from traitlets.config.configurable import Configurable
from traitlets import Integer, Float, Unicode, Bool

class Config(Configurable):
    username = Unicode(u'demo-username', config=True)
    password = Unicode(u'yourpassword', config=True)
    api_key = Unicode("0"*40, config=True)
    acc_type = Unicode("DEMO", config=True) # LIVE / DEMO
    acc_number = Unicode("AB0AB", config=True)

femtotrader avatar Oct 03 '15 07:10 femtotrader