This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
betfairng: A client library for Betfair API-NG
==============================================

.. image:: https://travis-ci.org/russgray/betfairng.svg?branch=master
:target: https://travis-ci.org/russgray/betfairng

Betfair API-NG is the next-gen version of the longstanding SOAP-based Betfair API v6. As of November 2014, API-NG will be the only way to programmatically access the Betfair exchange.

API-NG is a REST-based design rather than SOAP, and has improved consistency and convention that make it easier to work with. betfairng makes it easier still, with pythonic naming and sensible defaults.

.. code-block:: pycon

>>> market_filter = {
'eventTypeIds': [7],
'marketCountries': ['GB'],
'marketTypeCodes': ['WIN'],
'sort': 'FIRST_TO_START',
'from': datetime.now().isoformat()
}
>>> next_race = api.list_market_catalogue(filter=market_filter, marketProjection=['RUNNER_METADATA'], maxResults=1)[0]
>>> book = api.list_market_book(marketIds=['1.114185343'], priceProjection=dict(priceData=['EX_BEST_OFFERS']))

betfairng also provides a backwards-compatibility layer so you can continue to use the SOAP naming conventions (e.g. placeBets instead of place_orders, getMarketPrices instead of list_market_book, etc).


Installation
------------

From pypi::

pip install betfairng


Authentication
--------------

Betfair API-NG requires 2-way SSL for non-interactive logins (i.e. for bots or automated tools). Instructions for creating your certificate and registering it with Betfair `can be found on Betfair's website <https: api.developer.betfair.com="" services="" webapps="" docs="" x="" j4q6="">`_.

Once done, simply pass the paths to the .crt and .key files to the authenticate function along with your username and password.

.. code-block:: pycon
>>> from betfairng import authenticate
>>> cert = ('path/to/file.crt', 'path/to/file.key')
>>> resp = authenticate(cert, username, password)
>>> resp['loginStatus']
u'SUCCESS'
>>> resp['sessionToken']
u'<some_encoded_token>'
Release History

Release History

0.1.6

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
betfairng-0.1.6.tar.gz (6.7 kB) Copy SHA256 Checksum SHA256 Source Jan 3, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting