Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python Wrapper for Bet365 API

Project description

pybet365

https://img.shields.io/pypi/v/pybet365.svg https://img.shields.io/travis/leonkozlowski/pybet365.svg Documentation Status

Python Wrapper for Bet365 API

Installation

From source

$ git clone https://github.com/leonkozlowski/pybet365.git
$ cd pybet365

$ python3.8 -m venv venv
$ source venv/bin/activate
$ pip install -e .

# For test dependencies
$ pip install -r requirements_dev.txt

From build

$ pip install pybet365

Features

GET Request to Upcoming Events Endpoint

from pybet365 import Bet365

client = Bet365(api_host="someHost", api_key="someKey")
upcoming_events = client.upcoming_events(sport_id="49")

print(upcoming_events)

Response

{
  "success": 1,
  "pager": {
    "page": 1,
    "per_page": 50,
    "total": 102
  },
  "results": [
    {
      "id": "88107197",
      "sport_id": "92",
      "time": "1586480400",
      "time_status": "0",
      "league": {
        "id": "10036652",
        "name": "Moscow Liga Pro"
      },
      "home": {
        "id": "10423098",
        "name": "Evgenii Kryuchkov"
      },
      "away": {
        "id": "10433218",
        "name": "Aik Lulikyan"
      },
      "ss": null,
      "our_event_id": "2297143",
      "updated_at": "1586478473"
    }
  ]
}

Access response objects with dot notation

from pybet365 import Bet365

client = Bet365(api_host="someHost", api_key="someKey")
upcoming_events = client.upcoming_events(sport_id="49")

print(upcoming_events.success)
>>> 1

Access of array type results objects

from pybet365 import Bet365

client = Bet365(api_host="someHost", api_key="someKey")
upcoming_events = client.upcoming_events(sport_id="49")

print(upcoming_events.results[0].id)
>>> "88107197"

Environment Variables

  • BET365_HOST
    • $ export BET365_HOST=yourHost
  • BET365_KEY
    • $ export BET365_KEY=yourSecretKey

Testing

# Test with pytest
make tests

# Lint with flake8
make lint

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2020-07-25)

  • First release on PyPI.

Project details


Download files

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

Files for pybet365, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pybet365-0.1.1-py2.py3-none-any.whl (16.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pybet365-0.1.1.tar.gz (23.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page