rlstatsapi
Rust client and parser for Rocket League Stats API event streams over TCP, with optional Python bindings via PyO3.
What This Project Includes
- TCP client with reconnect support for Rocket League Stats API events.
- Typed event parsing (
StatsEvent) with support for unknown/forward-compatible events. - Event filtering and player/match tracking helpers (
EventFilter,PlayerTracker,MatchSignal). - Config helpers for optional Stats API INI handling.
- CLI binaries for raw, compact tick, and pretty filtered output.
- Optional Python extension module (
rlstatsapi) behind thepythonCargo feature. - Example Python library in
examples/python_library.
Requirements
- Rust toolchain (stable).
- Python 3.11+ (only needed for Python bindings and examples).
- Rocket League Stats API exporter enabled and sending to
127.0.0.1:49123(default).
Build and Test (Rust)
Binaries
1) Raw event dump
Optional INI path:
2) Compact tick listener
3) RL event listener with filters
4) Live player board (in-place console updates)
Default Connection and INI Behavior
- If you do not pass an INI path, the client uses localhost defaults (
127.0.0.1:49123) and does not edit an INI file. - If you pass
--ini <path>, the INI file is created when missing and updated according to client options.
Expected INI template:
[TAGame.MatchStatsExporter_TA]
; Port the client will listen for connections on
Port=49123
; How many times per second the game sends the update state (capped at 120, 0 disables this feature)
PacketSendRate=60
Python Bindings (PyO3)
The Python module is built from this crate with the python feature.
Rust-side check:
Package metadata for Python builds is defined in pyproject.toml.
Filtering helpers are exposed for Python users as well, including:
RocketLeagueStatsClient.next_filtered_event_json(...)rlstatsapi.list_event_kinds()rlstatsapi.event_matches(...)rlstatsapi.filter_event_json(...)rlstatsapi.match_signal_json(...)rlstatsapi.winner_team(...)
Example Python Library
A working Python consumer package is included at:
examples/python_library
Run it with uv:
Additional examples:
Library Usage (Rust)
use ;
async