Skip to main content

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.

Release files for betfair-python-rest 0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for betfair-python-rest 0.13
File Size Uploaded
betfair_python_rest-0.13.tar.gz 30.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for betfair-python-rest 0.13
File Interpreter ABI Platform
betfair_python_rest-0.13-py3-none-any.whl Python 3 none any Details

Total release size:94.7 kB

Release files / betfair_python_rest-0.13.tar.gz

Download URL betfair_python_rest-0.13.tar.gz
Size 30.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5658a0b1efa10e73d6a41582e5eaa9adcfa71b61f85835c7b76a7a90bdf17785
BLAKE2b-256 checksum
How to use checksums
705bf06b3da53a1e30ea572c2721d8a59b9f5d859bfc90829d969e72823d8397
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / betfair_python_rest-0.13-py3-none-any.whl

Download URL betfair_python_rest-0.13-py3-none-any.whl
Size 63.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85a940f7b4edadecc89da122bb0e362f2a56758aa2bd59c21691c7b6265b9a3d
BLAKE2b-256 checksum
How to use checksums
9f860ba8388d2d44436ea42050f98c2e296d5cda8e61ecdb5e2e831a0af73f1e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.13 This release

2 release files

0.12

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page