Skip to main content

openwec

Python SDK for endurance racing data — WEC, ELMS, ALMS, Le Mans Cup, IMSA.

Inspired by FastF1, OpenWEC gives you lap-by-lap timing data, stint analytics, and race results from endurance racing as pandas DataFrames — in one line.

→ openwec.com — Live dashboard
→ api.openwec.com/docs — API reference
→ github.com/palomacdev/openwec — Source


Installation

pip install openwec

# With plotting support
pip install openwec[plotting]

Quick start

import openwec

# Public endpoints work without a key.
# Request a free key at https://openwec.com/api-keys
openwec.configure(api_key="your-key-here")  # required for laps and analytics

# Load any session — WEC, ELMS, ALMS, Le Mans Cup, or IMSA
session = openwec.Session("WEC", 2026, "Le Mans", "Race")
print(session)
# Session(WEC 2026 LE MANS — Race, id=6556)

# Results as a DataFrame (no key needed)
results = session.results()
print(results[["position", "car_number", "car_class", "team", "drivers"]].head(10))

# Lap-by-lap data (key required)
laps = session.laps(car="7")
print(laps[["lap_number", "lap_time_s", "s1_s", "s2_s", "s3_s"]].head())

# Endurance-specific: filter laps by driver within a shared-drive car
# (unique to endurance racing — not possible in FastF1)
conway_laps     = session.driver_laps("Conway", car="7")
kobayashi_laps  = session.driver_laps("Kobayashi", car="7")
print(f"Conway pace:    {conway_laps['lap_time_s'].median():.3f}s")
print(f"Kobayashi pace: {kobayashi_laps['lap_time_s'].median():.3f}s")

# Stints and pace
stints     = session.stints(car_class="HYPERCAR")
pace       = session.pace(car_class="HYPERCAR")
pit_window = session.pit_window(car="7")

# Plots (requires matplotlib)
session.plot_lap_evolution(car="7")
session.plot_stint_chart(car_class="HYPERCAR")
session.plot_gap_to_leader(car_class="HYPERCAR")

Coverage

Series Seasons
FIA WEC 2012–2026
ELMS 2012–2026
ALMS (Asian) 2022–2026
Le Mans Cup 2017–2026
IMSA 2014–2026

2M+ laps across all series.


API key

Public endpoints (results, driver profiles, team profiles, driver search) require no key.
Lap-by-lap data and analytics endpoints require a free API key.

→ Request a key at openwec.com/api-keys


Errors and rate limits

Reads made without a key share a per-minute budget. A sweep over many sessions will reach it, and the API answers 429 with a Retry-After. Every failure mode has its own exception, so you can tell them apart:

Status Exception What it means
401 OpenWECAuthError no key, and this endpoint needs one
403 OpenWECPermissionError the key is valid but not allowed here
404 OpenWECNotFoundError no such session, driver or team
429 OpenWECRateLimitError budget spent — carries .retry_after
5xx OpenWECServerError the API failed; the request was fine

All of them derive from OpenWECError.

from openwec import OpenWECRateLimitError
import time

try:
    laps = session.laps()
except OpenWECRateLimitError as e:
    time.sleep(e.retry_after or 60)   # None means the API did not say
    laps = session.laps()

Or let the SDK wait for you. It is off by default — a library should not block your notebook without being asked:

openwec.configure(max_retries=3)          # wait out up to three 429s
openwec.configure(retry_max_wait=30)      # but never sleep more than 30s at once

A Retry-After longer than retry_max_wait raises instead of sleeping, and a 429 without a Retry-After always raises — there is nothing to wait for.

Configuring a key raises your budget and removes the shared one.


Session methods

Method Description Key required
.results() Race classification as DataFrame No
.laps(car=None) Lap-by-lap data Yes
.driver_laps(name, car=None) Laps filtered by driver name ⚑ Yes
.stints(car_class=None) Stint breakdown per car Yes
.pace(car_class=None) Average green-flag pace Yes
.gaps(car_class=None) Gap to leader evolution Yes
.pit_window(car=None) Optimal pit window estimate Yes
.plot_lap_evolution(car) Lap time chart Yes
.plot_stint_chart() Strategy/stint chart Yes
.plot_gap_to_leader() Gap to leader chart Yes

⚑ Unique to endurance racing — multiple drivers share a car. driver_laps() has no equivalent in FastF1.


Example notebooks

Notebook Description
le_mans_2026.ipynb Full race analysis — results, pace, stints, plots
driver_career.ipynb Cross-series career analysis for a driver

License

MIT — data sourced from Al Kamel Systems public timing exports.
Not affiliated with ACO, FIA, or any racing organization.

Metadata

Release files for openwec 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openwec 0.3.0
File Size Uploaded Provenance Actions
openwec-0.3.0.tar.gz 16.1 kB Without provenance Details for openwec-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openwec 0.3.0
File Interpreter ABI Platform Actions
openwec-0.3.0-py3-none-any.whl Python 3 none any Details for openwec-0.3.0-py3-none-any.whl

Total release size: 31.3 kB

Release files / openwec-0.3.0.tar.gz

Download URL openwec-0.3.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f0dc9573415fc7ea986a4125eba70920a0ab46e73c5fcd61123511ac52a7e04e
BLAKE2b-256 checksum
How to use checksums
d77dc39a72aa4f1611a84514edadef7e300c65a99a33e3b48a230aaf7cf39e27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / openwec-0.3.0-py3-none-any.whl

Download URL openwec-0.3.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56391ed42d718a4dea506436dc24628b737c39e0d6448e89bbc768862ba3d2d3
BLAKE2b-256 checksum
How to use checksums
7325605dddf23b42beecd1854155a913ecda5b0f0e467764e9101019fd064230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for openwec 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page