How to use the betfairlightweight.utils.clean_locals 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 / tests / unit / test_utils.py View on Github external
def test_clean_locals(self, params=None, filter=123):
        params = clean_locals(locals())
        assert params == {'filter': 123}
github liampauling / betfair / betfairlightweight / endpoints / historic.py View on Github external
:param from_day: day of month to start data from.
        :param from_month: month to start data from.
        :param from_year: year to start data from.
        :param to_day: day of month to end data at.
        :param to_month: month to end data at.
        :param to_year: year to end data at.
        :param event_id: id of a specific event to get data for.
        :param event_name: name of a specific event to get data for.
        :param market_types_collection: list of specific marketTypes to filter for.
        :param countries_collection: list of countries to filter for.
        :param file_type_collection: list of file types.
        :param requests.session session: Requests session object

        :rtype: dict
        """
        params = clean_locals(locals())
        method = 'GetAdvBasketDataSize'
        (response, elapsed_time) = self.request(method, params, session)
        return response
github liampauling / betfair / betfairlightweight / endpoints / scores.py View on Github external
def list_incidents(self, update_keys, session=None, lightweight=None):
        """
        Returns a list of incidents for the given events.

        :param dict update_keys: The filter to select desired markets. All markets that match
        the criteria in the filter are selected e.g. [{'eventId': '28205674', 'lastUpdateSequenceProcessed': 2}]
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: list[resources.Incidents]
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listIncidents')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.Incidents, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / scores.py View on Github external
def list_available_events(self, event_ids=None, event_type_ids=None, event_status=None, session=None,
                              lightweight=None):
        """
        Search for events that have live score data available.

        :param list event_ids: Optionally restricts the results to the specified event IDs
        :param list event_type_ids: Optionally restricts the results to the specified event type IDs
        :param list event_status: Optionally restricts the results to the specified event status
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: list[resources.AvailableEvent]
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listAvailableEvents')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.AvailableEvent, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / scores.py View on Github external
def list_scores(self, update_keys, session=None, lightweight=None):
        """
        Returns a list of current scores for the given events.

        :param list update_keys: The filter to select desired markets. All markets that match
        the criteria in the filter are selected e.g. [{'eventId': '28205674', 'lastUpdateSequenceProcessed': 2}]
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: list[resources.Score]
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listScores')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.Score, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / account.py View on Github external
include_item=None, wallet=None, session=None, lightweight=None):
        """
        Get account statement.

        :param str locale: The language to be used where applicable.
        :param int from_record: Specifies the first record that will be returned
        :param int record_count: Specifies the maximum number of records to be returned.
        :param dict item_date_range: Return items with an itemDate within this date range.
        :param str include_item: Which items to include, if not specified then defaults to ALL.
        :param str wallet: Which wallet to return statementItems for.
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: resources.AccountStatementResult
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'getAccountStatement')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.AccountStatementResult, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / betting.py View on Github external
:param list customer_order_refs: Optionally restricts the results to the specified customer order references
        :param list customer_strategy_refs: Optionally restricts the results to the specified customer strategy
        references
        :param dict date_range: Optionally restricts the results to be from/to the specified date, these dates
        are contextual to the orders being returned and therefore the dates used to filter on will change
        to placed, matched, voided or settled dates depending on the orderBy
        :param str order_by: Specifies how the results will be ordered. If no value is passed in, it defaults to BY_BET
        :param str sort_dir: Specifies the direction the results will be sorted in
        :param int from_record: Specifies the first record that will be returned
        :param int record_count: Specifies how many records will be returned from the index position 'fromRecord'
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: resources.CurrentOrders
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listCurrentOrders')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.CurrentOrders, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / scores.py View on Github external
def list_race_details(self, meeting_ids=None, race_ids=None, session=None, lightweight=None):
        """
        Search for races to get their details.

        :param dict meeting_ids: Optionally restricts the results to the specified meeting IDs.
        The unique Id for the meeting equivalent to the eventId for that specific race as
        returned by listEvents
        :param str race_ids: Optionally restricts the results to the specified race IDs. The
        unique Id for the race in the format meetingid.raceTime (hhmm). raceTime is in GMT
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: list[resources.RaceDetail]
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listRaceDetails')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.RaceDetails, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / betting.py View on Github external
def list_event_types(self, filter=market_filter(), locale=None, session=None, lightweight=None):
        """
        Returns a list of Event Types (i.e. Sports) associated with the markets
        selected by the MarketFilter.

        :param dict filter: The filter to select desired markets
        :param str locale: The language used for the response
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: list[resources.EventTypeResult]
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'listEventTypes')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.EventTypeResult, elapsed_time, lightweight)
github liampauling / betfair / betfairlightweight / endpoints / betting.py View on Github external
:param str market_id: The market id these orders are to be placed on
        :param list instructions: The number of place instructions
        :param str customer_ref: Optional parameter allowing the client to pass a unique string
        (up to 32 chars) that is used to de-dupe mistaken re-submissions
        :param dict market_version: Optional parameter allowing the client to specify which
        version of the market the orders should be placed on, e.g. "{'version': 123456}"
        :param str customer_strategy_ref: An optional reference customers can use to specify
        which strategy has sent the order
        :param bool async_: An optional flag (not setting equates to false) which specifies if
        the orders should be placed asynchronously
        :param requests.session session: Requests session object
        :param bool lightweight: If True will return dict not a resource

        :rtype: resources.PlaceOrders
        """
        params = clean_locals(locals())
        method = '%s%s' % (self.URI, 'placeOrders')
        (response, elapsed_time) = self.request(method, params, session)
        return self.process_response(response, resources.PlaceOrders, elapsed_time, lightweight)