How to use the betfairlightweight.utils.strp_betfair_time function in betfairlightweight

To help you get started, we’ve selected a few betfairlightweight examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, time_range):
        self._from = strp_betfair_time(time_range.get('from'))
        self.to = strp_betfair_time(time_range.get('to'))
github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, date_time_sent, raw_response, market_catalogue):
        super(MarketCatalogue, self).__init__(date_time_sent, raw_response)
        self.market_id = market_catalogue.get('marketId')
        self.market_name = market_catalogue.get('marketName')
        self.total_matched = market_catalogue.get('totalMatched')
        self.market_start_time = strp_betfair_time(market_catalogue.get('marketStartTime'))
        if 'competition' in market_catalogue:
            self.competition = EventType(market_catalogue.get('competition'))
        if 'event' in market_catalogue:
            self.event = Event(market_catalogue.get('event'))
        if 'eventType' in market_catalogue:
            self.event_type = EventType(market_catalogue.get('eventType'))
        if 'description' in market_catalogue:
            self.description = MarketCatalogueDescription(market_catalogue.get('description'))
        if 'runners' in market_catalogue:
            self.runners = {runner.get('selectionId'): RunnerCatalogue(runner) for runner
                            in market_catalogue.get('runners')}
github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, time_range):
        self._from = strp_betfair_time(time_range.get('from'))
        self.to = strp_betfair_time(time_range.get('to'))
github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, event):
        self.id = event.get('id')
        self.open_date = strp_betfair_time(event.get('openDate'))
        self.time_zone = event.get('timezone')
        self.country_code = event.get('countryCode')
        self.name = event.get('name')
        self.venue = event.get('venue')
github liampauling / betfair / betfairlightweight / parse / apiparsebetting.py View on Github external
def __init__(self, instruction_report):
        self.status = instruction_report.get('status')
        if self.status == 'SUCCESS':
            self.size_cancelled = instruction_report.get('sizeCancelled')
            self.cancelled_date = strp_betfair_time(instruction_report.get('cancelledDate'))
        self.error_code = instruction_report.get('errorCode')
        self.instruction = CancelOrderInstruction(instruction_report.get('instruction'))
github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, runner_book):
        self.selection_id = runner_book.get('selectionId')
        self.status = runner_book.get('status')
        self.total_matched = runner_book.get('totalMatched')
        self.adjustment_factor = runner_book.get('adjustmentFactor')
        self.handicap = runner_book.get('handicap')
        self.last_price_traded = runner_book.get('lastPriceTraded')
        self.removal_date = strp_betfair_time(runner_book.get('removalDate'))
        if 'sp' in runner_book:
            self.sp = RunnerBookSP(runner_book.get('sp'))
        if 'ex' in runner_book:
            self.ex = RunnerBookEX(runner_book.get('ex'))
        if 'orders' in runner_book:
            self.orders = [RunnerBookOrder(order) for order in runner_book.get('orders')]
        if 'matches' in runner_book:
            self.matches = [RunnerBookMatch(match) for match in runner_book.get('matches')]
github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, description):
        self.betting_type = description.get('bettingType')
        self.bsp_market = description.get('bspMarket')
        self.discount_allowed = description.get('discountAllowed')
        self.market_base_rate = description.get('marketBaseRate')
        self.market_time = strp_betfair_time(description.get('marketTime'))
        self.market_type = description.get('marketType')
        self.persistence_enabled = description.get('persistenceEnabled')
        self.regulator = description.get('regulator')
        self.rules = description.get('rules')
        self.rules_has_date = description.get('rulesHasDate')
        self.suspend_time = strp_betfair_time(description.get('suspendTime'))
        self.turn_in_play_enabled = description.get('turnInPlayEnabled')
        self.wallet = description.get('wallet')
github liampauling / betfair / betfairlightweight / parse / apiparseaccount.py View on Github external
def __init__(self, statement):
        self.amount = statement.get('amount')
        self.balance = statement.get('balance')
        self.item_class = statement.get('itemClass')
        self.item_class_data = statement.get('itemClassData')
        self.item_date = strp_betfair_time(statement.get('itemDate'))
        self.legacy_data = AccountStatementLegacyData(statement.get('legacyData'))
        self.ref_id = statement.get('refId')
github liampauling / betfair / betfairlightweight / parse / apiparsedata.py View on Github external
def __init__(self, order):
        self.bet_id = order.get('betId')
        self.bet_count = order.get('betCount')
        self.bet_outcome = order.get('betOutcome')
        self.event_id = order.get('eventId')
        self.event_type_id = order.get('eventTypeId')
        self.handicap = order.get('handicap')
        self.last_matched_date = strp_betfair_time(order.get('lastMatchedDate'))
        self.market_id = order.get('marketId')
        self.order_type = order.get('orderType')
        self.persistence_type = order.get('persistenceType')
        self.placed_date = strp_betfair_time(order.get('placedDate'))
        self.price_matched = order.get('priceMatched')
        self.price_reduced = order.get('priceReduced')
        self.price_requested = order.get('priceRequested')
        self.profit = order.get('profit')
        self.selection_id = order.get('selectionId')
        self.settled_date = strp_betfair_time(order.get('settledDate'))
        self.side = order.get('side')
        self.size_settled = order.get('sizeSettled')
github liampauling / betfair / betfairlightweight / parse / apiparsescores.py View on Github external
def __init__(self, date_time_sent, raw_response, result):
        super(Score, self).__init__(date_time_sent, raw_response)
        self.result = result

        self.event_id = result.get('eventId')
        self.start_time = strp_betfair_time(result.get('startTime'))
        self.broadcast = Broadcast(result.get('broadcasts'))

        state = result.get('state')
        if state:
            event_type_id = state.get('eventTypeId')
            if event_type_id == 1:
                self.state = SoccerState(state)
            elif event_type_id == 2:
                self.state = TennisState(state)
            elif event_type_id == 4:
                self.state = CricketState(state)