r055y
r055y ("rossy") is an open-source Python library for building auditable sports analytics and outcome-prediction systems.
It provides the reusable analytics foundation behind R-LAY: strict data contracts, probability evaluation, calibration summaries, and transparent rating baselines that can be used independently in other Python projects.
Install
pip install r055y
r055y supports Python 3.10 and newer.
What is included
The 1.1 release introduces three focused building blocks:
- Contracts — immutable Pydantic models for SPORT SELECT POOLS cards, game predictions, run artifacts, and reproducibility manifests.
- Evaluation — Brier score, binary log loss, and fixed-width calibration bins for probabilistic forecasts.
- Ratings — a stateful Elo baseline with configurable home advantage, neutral-site support, ties, and between-season mean reversion.
Quick start
Elo ratings
from r055y import EloRatingSystem
ratings = EloRatingSystem()
pregame = ratings.predict("BUF", "MIA")
print(pregame.home_win_probability)
# Updates both teams after the result while preserving the pregame prediction.
ratings.update("BUF", "MIA", home_score=31, away_score=24)
Probability evaluation
from r055y import brier_score, calibration_bins, log_loss
probabilities = [0.72, 0.55, 0.31, 0.84]
outcomes = [1, 0, 0, 1]
print(brier_score(probabilities, outcomes))
print(log_loss(probabilities, outcomes))
for bucket in calibration_bins(probabilities, outcomes, bins=5):
print(bucket)
Auditable predictions
from r055y import GamePrediction
prediction = GamePrediction(
game_id="2026_01_MIA_BUF",
model_name="example-rating-model",
model_version="1.0.0",
home_win_probability=0.72,
predicted_home_margin=4.5,
reasons=("home-field advantage", "higher pregame rating"),
)
print(prediction.model_dump_json(indent=2))
Contracts reject unknown fields, invalid probabilities, and timezone-naive timestamps so bad inputs fail visibly instead of drifting silently through an analytics pipeline.
Design principles
- Prefer calibrated probabilities over unsupported confidence labels.
- Keep model inputs, versions, outputs, and evaluations traceable.
- Use transparent baselines before adding model complexity.
- Keep provider credentials, scraping logic, operational schedules, private datasets, and website code outside the public library.
Package layout
src/r055y/
contracts/ Portable analytics input/output schemas
evaluation/ Probability scoring and reliability summaries
ratings/ Transparent rating baselines
Development
python -m pip install -e ".[test]"
python -m pytest
r055y is deliberately small today. Additional feature, modelling, simulation, and optimization utilities will be added as their contracts and evaluation requirements become dependable.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file r055y-1.1.0.tar.gz.
File metadata
- Download URL: r055y-1.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b311a51adc068bb6da4e3d094e462cdd8d01be20cd4bb41340fd1bce4c0a1bd0
|
|
| MD5 |
4b8e8ae82d4b169fb6381c3406c11cb7
|
|
| BLAKE2b-256 |
be098493c605b31b34e4fc0fa784d38674d20284187af56fa0ce3d9174943ccb
|
File details
Details for the file r055y-1.1.0-py3-none-any.whl.
File metadata
- Download URL: r055y-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b1bdbad3050a30c210bbdd24e857b48ca99f3908f2e8085204c54d8a4b8b792
|
|
| MD5 |
a6c74c5935c9a5a9025c2e0189235e43
|
|
| BLAKE2b-256 |
abe9824ea1b0d926531304a20e6edaa11aa39955d74b758a78a5530c7cbdfacb
|