Skip to main content

A Python library for Race Monitor

Project description

race-monitor-py

A Python library for Race Monitor

Python Tests

Requirements

  • Python 3.10 or later
  • A Race Monitor API token — obtainable from your account at race-monitor.com

Installation

pip install race-monitor

Or with uv:

uv add race-monitor

Quick Start

Sync

from race_monitor import RaceMonitorClient

with RaceMonitorClient(api_token="YOUR_TOKEN") as client:
    race = client.race.details(race_id=12345)
    print(race["Race"]["Name"])

    if client.race.is_live(race_id=12345)["IsLive"]:
        session = client.live.get_session(race_id=12345)
        for racer_id, competitor in session["Session"]["Competitors"].items():
            print(competitor["Position"], competitor["FirstName"], competitor["LastName"])

Async

import asyncio
from race_monitor import AsyncRaceMonitorClient

async def main():
    async with AsyncRaceMonitorClient(api_token="YOUR_TOKEN") as client:
        race = await client.race.details(race_id=12345)
        print(race["Race"]["Name"])

asyncio.run(main())

API Namespaces

All endpoints are grouped into namespaces, accessible as client.<namespace>:

Namespace Description
account Races associated with your relaying account
common Reference data: app sections, race types, series
live Real-time timing data: session, competitors, lap times
race Race details and live status
results Post-race results and competitor details

Type Annotations

All methods return typed dicts from race_monitor.types, enabling IDE autocompletion and static type checking:

from race_monitor import RaceMonitorClient
from race_monitor.types import GetSessionResponse, LiveCompetitor

with RaceMonitorClient(api_token="YOUR_TOKEN") as client:
    session: GetSessionResponse = client.live.get_session(race_id=12345)
    competitor: LiveCompetitor = session["Session"]["Competitors"]["42"]

Contributing

Contributions are welcome. A few areas where help is especially useful:

  • Live streamingclient.live.get_streaming_connection() returns connection credentials (socket host, WebSocket URLs, and a timing token), but the actual socket/WebSocket connection and streaming protocol handling are not implemented in this library. Testing requires an active Race Monitor relay account. If you have relay access and want to validate or extend the streaming support, please open an issue or PR.
  • Media endpoints — The /v2/Media controller (HLS video stream management) is not yet implemented. See docs/api-coverage.md for the full list of missing endpoints.

Documentation

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

race_monitor-0.6.0.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

race_monitor-0.6.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file race_monitor-0.6.0.tar.gz.

File metadata

  • Download URL: race_monitor-0.6.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for race_monitor-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c60d485121c0bbb4d48311ddccc78979aca587473e45048211d8f4b9b479c4da
MD5 8fb19d784f0bf9bf89005a12bd99f890
BLAKE2b-256 14e7585e297db952a8a1bc2ea1dde1e07705a4436e510c8adcefb7c6de9517c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for race_monitor-0.6.0.tar.gz:

Publisher: release-please.yml on WOT-Lemons/race-monitor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file race_monitor-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: race_monitor-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for race_monitor-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4f460320399b4aa93c5a5452c5c5962d9494b75fc677836daab8495a1ac9c62
MD5 52451e88383d182db4642463a7323877
BLAKE2b-256 fbc219165ef47b3c342931a43b3209946b2a731a1e67c07f2b6ebf238c7be4eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for race_monitor-0.6.0-py3-none-any.whl:

Publisher: release-please.yml on WOT-Lemons/race-monitor-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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