Skip to main content

A Python wrapper for RuStat API

Project description

rustat-python-api

Python wrapper for the Rustat API

Example of usage:

  1. Install the package:
pip install rustat-python-api
  1. Usage:
from rustat_python_api import RuStatParser, DynamoLab, PitchControl

user = "your_login"
password = "your_password"

parser = RuStatParser(user, password)

info = parser.get_rpl_info()
keys = list(info.keys())
season_id, team_id = keys[-1], info[keys[-1]]["season_teams"][0]["id"]

schedule = parser.get_schedule(team_id, season_id)
keys = list(schedule.keys())
match_id = keys[-1]

events, subs = parser.get_events(match_id, process=True, return_subs=True)
stats = parser.get_match_stats(match_id)
tracking = parser.get_tracking(match_id)

host = "http://localhost:8001/"
client = DynamoLab(host)
client.run_model(
    model="xT",
    data=events,
    inplace=True,
    inplace_column=model
)

pc = PitchControl(tracking, events)
pc.draw_pitch_control(half=1, tp=100, save=True, filename="pitch_control")
# ffmpeg required for animation
pc.animate_pitch_control(half=1, tp=100, frames=30, filename="pitch_control")

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

rustat-python-api-0.5.4.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

rustat_python_api-0.5.4-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file rustat-python-api-0.5.4.tar.gz.

File metadata

  • Download URL: rustat-python-api-0.5.4.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for rustat-python-api-0.5.4.tar.gz
Algorithm Hash digest
SHA256 bd195e5e3d9e33abab850595aefa43a3aedb701ee90ba7fe510f7ccba66d2de9
MD5 1182a27e4ebb3c7e51a0505ab5f00c38
BLAKE2b-256 a3e3d7b724445eeb6695bf9cf9ceb5f862ba3f21f65a07094b7c7802e5744079

See more details on using hashes here.

File details

Details for the file rustat_python_api-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for rustat_python_api-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9022b2dd55d666e806830a070bbb96e14b4ac4919771cdc1669a46b0f267a858
MD5 08f0c1cb462e9f0fc1fbc7b7992b9b4c
BLAKE2b-256 e06da9a306fd667221ab214310b934ca36303e86829ddc80198d3cb9726599e9

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