The Odds-Api
Installation
The package requires Python 3.7 or higher.
Install latest version from PyPI: pip install oddsapi
Description
The Odds-API provides sports odds data for loads of sports from bookmakers around the world. Get your free API key here.
Usage
Please refer to documentation for detailed instructions for The Odds-Api.
To start using the wrapper import and initialize the OddsApiClient from the package.
from oddsapi import OddsApiClient
client = OddsApiClient(api_key='YOUR KEY')
response = client.retrieve_sports()
The response is a custom object that stores the data in nested namespaces and dictionary format.
response.data[0]
>>> Collection(active=True,
details='US College Football',
group='American Football',
has_outrights=False,
key='americanfootball_ncaaf',
title='NCAAF')
#alternatively
response.json['data'][0]
>>> {'key': 'americanfootball_ncaaf',
'active': True,
'group': 'American Football',
'details': 'US College Football',
'title': 'NCAAF',
'has_outrights': False}
response.rate_info
>>> {'requests_remaining': '479', 'requests_used': '21'}
The client can also be configured to work with asyncio.
from asyncio import gather
client.aio = True
cors = [client.retrieve_odds(
sport_key=sport.key,
region='us',
mkt='spreads'
) for sport in response.data[:4]]
responses = client.loop.run_until_complete(gather(*cors))
Keep in mind that rate_info will not be recorded in order.
Contact
Email me at sarartur.ruk@gmail.com or open a new Issue on Github.
Metadata
Release files for oddsapi 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oddsapi-1.2.4.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oddsapi-1.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / oddsapi-1.2.4.tar.gz
| Download URL | oddsapi-1.2.4.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7db3611e2e831e0a9c6147ce8769ddcbf65e5a499a3892369f075c58c28b3646
|
|
BLAKE2b-256 checksum How to use checksums |
7b03290c1e4b179020639639a72a379a07f40b16a84d1f59b2f30e94468b5295
|
| 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/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
|
Release files / oddsapi-1.2.4-py3-none-any.whl
| Download URL | oddsapi-1.2.4-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d67f433a62665aafe80df40c94dd621fe6b54ce9be24fea43d85131bceb97ada
|
|
BLAKE2b-256 checksum How to use checksums |
8d9321d75d3bcbd46b3b8a3dc162b0b5819a29d23199cac5cc9263b40ff98028
|
| 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/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6
|