Skip to main content

Glicko-2 based rating engine for competitive hot-air balloon pilots.

Project description

balloon-ranking-glicko

A Glicko-2 based rating engine for competitive hot-air balloon pilots.

This is the public, open-source rating math behind the Global Balloon Pilot Ranking System. It is a pure-Python package with zero runtime dependencies. Given a chronological history of competition events, it produces a Glicko-2 rating, rating deviation (RD), and volatility for every pilot, plus derived values (Strength of Field, tier assignments).

Design

  • Algorithm: Glicko-2, implemented directly from Mark Glickman's specification.
  • Input signal: task finishing position, not raw points. Position is the cleaner signal of "did this pilot beat that pilot in this task".
  • Rating period: one per event. All pairwise outcomes from all of an event's tasks are pooled into a single Glicko-2 update per pilot.
  • No-result handling: no-result pilots are tied for last within the no-result group. This matches FAI scoring conventions.
  • Pure functions, zero I/O: no database, no network, no file I/O. The caller supplies events and prior ratings; the engine returns new ratings.

The engine has no opinions about storage or identity. The caller supplies events plus the rating state entering each event; the engine returns the state coming out.

Install

pip install balloon-ranking-glicko

Quick start

from datetime import date
from balloon_ranking_glicko import Event, Task, TaskResult, RatingEngine

event = Event(
    event_id="example-2026",
    event_date=date(2026, 6, 1),
    tasks=(
        Task(
            task_id="t1",
            results=(
                TaskResult(pilot_id="alice", position=1),
                TaskResult(pilot_id="bob", position=2),
                TaskResult(pilot_id="carol", position=3),
            ),
        ),
    ),
)

engine = RatingEngine()
ratings = engine.process_history([event])
for pid, r in sorted(ratings.items(), key=lambda kv: -kv[1].rating):
    print(f"{pid}: {r.rating:.1f} (RD {r.rd:.1f})")

Public API

  • Event, Task, TaskResult, PilotRating — frozen dataclasses
  • RatingEngine(tau, initial_rating, initial_rd, initial_volatility)
    • process_event(event, prior_ratings) -> dict[str, PilotRating]
    • process_history(events) -> dict[str, PilotRating]
    • process_history_with_snapshots(events) -> Iterator[(Event, dict[str, PilotRating])]
  • compute_sof(event, ratings) -> float
  • assign_tiers(ratings, cutoffs=None) -> dict[str, str]

Development

pip install -e ".[dev]"
pytest
mypy

The Glicko-2 implementation is validated against the worked example from Glickman's paper (final rating 1464.06, RD 151.52, volatility 0.05999).

License

MIT

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

balloon_ranking_glicko-0.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

balloon_ranking_glicko-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file balloon_ranking_glicko-0.1.0.tar.gz.

File metadata

  • Download URL: balloon_ranking_glicko-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for balloon_ranking_glicko-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29adeac08dcffd927cb549923b976daefc35e06a17329b334d3972ea80d8b547
MD5 e2eece684dbf09b581a030ba642b811a
BLAKE2b-256 13a3b7d10f708d07cf94dffe672453f642562d172e44b023e835719a2cdca858

See more details on using hashes here.

Provenance

The following attestation bundles were made for balloon_ranking_glicko-0.1.0.tar.gz:

Publisher: publish.yml on zerekw/balloon-ranking-glicko

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

File details

Details for the file balloon_ranking_glicko-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for balloon_ranking_glicko-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 402d64ccc9fc25f39fee94c895120339c296ba9d1c428cead38cc706aeb02b78
MD5 6fd6ad9bc001105675e1d6af8db3ef34
BLAKE2b-256 b495ae8f334d9eaef72b0f8ca646a2ff880c094e4282563aa32f2514e283399d

See more details on using hashes here.

Provenance

The following attestation bundles were made for balloon_ranking_glicko-0.1.0-py3-none-any.whl:

Publisher: publish.yml on zerekw/balloon-ranking-glicko

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