Metadata-Version: 2.4
Name: race-monitor
Version: 0.3.0
Summary: A Python library for Race Monitor
Project-URL: Homepage, https://wot-lemons.github.io/race-monitor-py
Project-URL: Source, https://github.com/WOT-Lemons/race-monitor-py
Project-URL: Bug Tracker, https://github.com/WOT-Lemons/race-monitor-py/issues
Project-URL: Changelog, https://github.com/WOT-Lemons/race-monitor-py/blob/main/CHANGELOG.md
Author: WOT-Lemons
License: MIT License
        
        Copyright (c) 2026 Church of Focism
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: api,client,motorsport,race monitor,racing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# race-monitor-py

A Python library for [Race Monitor](https://www.race-monitor.com/)

[![Python Tests](https://github.com/WOT-Lemons/race-monitor-py/actions/workflows/pytest.yml/badge.svg?branch=main&event=push)](https://github.com/WOT-Lemons/race-monitor-py/actions/workflows/pytest.yml)

## Requirements

- Python 3.10 or later
- A Race Monitor API token — obtainable from your account at [race-monitor.com](https://www.race-monitor.com/)

## Installation

```bash
pip install race-monitor
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv add race-monitor
```

## Quick Start

### Sync

```python
from race_monitor import RaceMonitorClient

# All methods return parsed JSON as Python dicts.
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)
        # work with session data — see API docs for field names
```

### Async

```python
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 |

## Documentation

- Full library API reference: <https://wot-lemons.github.io/race-monitor-py>
- Race Monitor API: <https://www.race-monitor.com/APIDocs>
