Example #1
0
 def test_apiclient_init(self):
     client = APIClient('username', 'password')
     assert str(client) == 'APIClient'
     assert repr(client) == '<APIClient [username]>'
     assert isinstance(client.betting, Betting)
     assert isinstance(client.account, Account)
     assert isinstance(client.market_data, MarketData)
     assert isinstance(client.reference_data, ReferenceData)
Example #2
0
 def __init__(self):
     account = config.L_ACCOUNTS[0]
     self.api = APIClient(account['username'], account['password'])
     self.soccer_id = self._getSoccerId()
     self.line2league = {}
     self.line2event = {}
     self.odds_last = None
     self.fixtures_last = None
     self.leagues = {}
     self.events = {}
     self.lines = {}
     self.updateLeagues()
 def setUp(self):
     client = APIClient('username', 'password')
     self.reference_data = ReferenceData(client)
Example #4
0
 def __init__(self):
     self.api = APIClient(pin_user, pin_passwd)
Example #5
0
 def setUp(self):
     client = APIClient('username', 'password')
     self.betting = Betting(client)
Example #6
0
 def setUp(self):
     client = APIClient('username', 'password')
     self.account = Account(client)
Example #7
0
 def __init__(self):
     self.apis = [
         APIClient(account['username'], account['password'])
         for account in config.B_ACCOUNTS
     ]
     self.api_index = 0
Example #8
0
 def __init__(self):
     with open("config.yml", 'r') as ymlfile:
         self.cfg = yaml.load(ymlfile)
         self.api = APIClient(self.cfg['pinnacle']['api']['username'],
                              self.cfg['pinnacle']['api']['password'])
Example #9
0
sys.path.append("..")  # Adds higher directory to python modules path.

from utils.wrapper import get_info_event, get_event_live
from settings import *

# Local Settings
MIN_ODD = 1.8
SECONDS_SLEEP = 10
PERIOD = 1
BUY_AVAILABLE = False
STAKE = 5.0
OVER = 0.5
FILE_RESULTS = 'results.csv'

# Authentication
api = APIClient(USERNAME, PASSWORD)
lst_events_betted = []  # Event betted list.


def sleep():
    print('\n \n')
    time.sleep(SECONDS_SLEEP)


# Check Odds
def check_odds():
    list_ids_live = []

    # Get live events (first period)
    inrunning = api.market_data.get_inrunning()
    for s in inrunning['sports']:  # iterate sports