-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconnection.py
More file actions
30 lines (27 loc) · 835 Bytes
/
Copy pathconnection.py
File metadata and controls
30 lines (27 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
_ __ _____
| |/ /_ _| ___|_ ___ __ __ _
| ' /\ \ /\ / / |_ \ \/ / '_ \ / _` |
| . \ \ V V /| _| > <| | | | (_| |
|_|\_\ \_/\_/ |_| /_/\_\_| |_|\__, |
|___/
Created on Sun May 20 13:59:59 2018
@author: KwFung
"""
import configparser
from oandapyV20 import API
class Connection:
config = {}
API = None
def __init__(self):
# Load config
config = configparser.ConfigParser()
config.read('config.ini')
mode = config['ENV']['MODE']
Connection.config = config[mode]
# Load API
environment = Connection.config['TYPE']
access_token = Connection.config['AUTH_TOKEN']
Connection.API = API(access_token, environment)