Skip to main content

Python package of REST API managers (Betting and Accounts APIs)

Project description

Python package of REST API managers (Betting and Accounts APIs)

HOW TO INSTALL
pip install betfair-python-rest

Create your own class based on the one that comes in the package, indicating the certificate information. Example:

class CustomBetFairAPIManagerBetting(BetFairAPIManagerBetting):
    crt_path = os.path.join('home', 'user', 'your_project', 'client-2048.crt')
    crt_key_path = os.path.join('home', 'user', 'your_project-u', 'client-2048.key')

Now you can use it like that:

api_manager = CustomBetFairAPIManagerBetting(login, password, api_key, log_mode=True)
market_and_locale = MarketFilterAndLocaleForm(text_query='Soccer')
api_manager.list_event_types(request_class_object=market_and_locale)

HOW TO USE (with examples)

In short, the package is designed like this:

managers - API-managers classes

forms - Classes which describing the schemes of data inputs for every method

enums - Classes with a list of possible options for parameter values.

exceptions - There is just two files: exceptions class and enum with variables of error code from server

File with examples of using: example.py

I should clarify a one point: API-methods in Betting branch waiting for form classes objects, not just arguments array. This was done due to the fact that many methods accept the same fields, and sometimes entire sets of fields, and in order to avoid copy-paste of attributes and docstring into dozens of models, it was decided to make each method accept an object of the class of the corresponding form.

True, this leads to the fact that the fields themselves are scattered in dozens of classes, which can cause discomfort when you first familiarize yourself with the package. I tried to smooth out this flaw a little, accompanying each class with explanations.

As a result, if, for example, you want to find the country by the line "land", then you will need to use the MarketFilterAndLocaleForm class and pass arguments there. the names are kept exactly and are only slightly adapted to the Pep8 standard, so that you quickly understand what’s what (especially if autocompletion is included in the IDE)

All forms are located in the forms folder and repeat the names of the requests, so you can easily find them even without auto-completion (I hope)

This feature does not apply to Accounts manager: requests of this category accept few requests, practically do not repeat among themselves according to a set of input data. Therefore, there, at the entrance to the methods, a familiar series of arguments, not a form.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

betfair_python_rest-0.13.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

betfair_python_rest-0.13-py3-none-any.whl (63.8 kB view details)

Uploaded Python 3

File details

Details for the file betfair_python_rest-0.13.tar.gz.

File metadata

  • Download URL: betfair_python_rest-0.13.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for betfair_python_rest-0.13.tar.gz
Algorithm Hash digest
SHA256 5658a0b1efa10e73d6a41582e5eaa9adcfa71b61f85835c7b76a7a90bdf17785
MD5 fc9b6a34e37f50602e200fe0db075be7
BLAKE2b-256 705bf06b3da53a1e30ea572c2721d8a59b9f5d859bfc90829d969e72823d8397

See more details on using hashes here.

File details

Details for the file betfair_python_rest-0.13-py3-none-any.whl.

File metadata

  • Download URL: betfair_python_rest-0.13-py3-none-any.whl
  • Upload date:
  • Size: 63.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for betfair_python_rest-0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 85a940f7b4edadecc89da122bb0e362f2a56758aa2bd59c21691c7b6265b9a3d
MD5 cd7ba93e461c4d2faa0b3cf2148630ea
BLAKE2b-256 9f860ba8388d2d44436ea42050f98c2e296d5cda8e61ecdb5e2e831a0af73f1e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page