Skip to main content

Unofficial Python API client for the ballchasing.com API.

Project description

ballchaser ⚽️🚗

PyPI Code style: black Imports: isort

Unofficial Python API client for the ballchasing.com API.

Usage

pip install ballchaser

All API requests are exposed via the BallChaser class which is initialised with a ballchasing.com API token.

import os

from ballchaser.client import BallChaser

ball_chaser = BallChaser(os.getenv("BALLCHASING_API_TOKEN"))

# search and retrieve replay metadata
replays = [
    replay
    for replay in ball_chaser.list_replays(player_name="GarrettG", replay_count=10)
]

# retrieve replay statistics
replay_stats = [
    ball_chaser.get_replay(replay["id"])
    for replay in replays
]

API requests can automatically be retried if they return a rate limit response by specifying backoff=True. Requests will be tried up to max_tries times with exponential backoff between subsequent retries, e.g.

import os

from ballchaser.client import BallChaser

ball_chaser = BallChaser(os.getenv("BALLCHASING_API_TOKEN"), backoff=True, max_tries=5)

Contributing & Feedback

If there are any new features you'd like, or you encounter a bug, you can contribute by opening an issue or submitting a pull request.

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

ballchaser-0.8.0.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

ballchaser-0.8.0-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

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