{"id":16558910,"url":"https://github.com/wakingrufus/lib-elo","last_synced_at":"2026-06-01T04:31:52.025Z","repository":{"id":57723948,"uuid":"111416953","full_name":"wakingrufus/lib-elo","owner":"wakingrufus","description":"Library for ELO calculations for a game league","archived":false,"fork":false,"pushed_at":"2019-02-28T23:13:26.000Z","size":21,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T01:45:27.754Z","etag":null,"topics":["elo","elo-rating","kotlin"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wakingrufus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-20T13:55:41.000Z","updated_at":"2024-12-13T01:17:59.000Z","dependencies_parsed_at":"2022-09-02T06:55:03.311Z","dependency_job_id":null,"html_url":"https://github.com/wakingrufus/lib-elo","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/wakingrufus/lib-elo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakingrufus%2Flib-elo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakingrufus%2Flib-elo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakingrufus%2Flib-elo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakingrufus%2Flib-elo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wakingrufus","download_url":"https://codeload.github.com/wakingrufus/lib-elo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakingrufus%2Flib-elo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33760645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elo","elo-rating","kotlin"],"created_at":"2024-10-11T20:24:06.892Z","updated_at":"2026-06-01T04:31:52.002Z","avatar_url":"https://github.com/wakingrufus.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib-elo\nLibrary for ELO calculations for game leagues\n\n[![Run Status](https://api.shippable.com/projects/5a12e20c79f26b0700c37035/badge?branch=master)](https://app.shippable.com/github/wakingrufus/lib-elo)\n[![Coverage Badge](https://api.shippable.com/projects/5a12e20c79f26b0700c37035/coverageBadge?branch=master)](https://app.shippable.com/github/wakingrufus/lib-elo)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.wakingrufus/lib-elo/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.wakingrufus/lib-elo)\n\n## Features\n- Fully configurable _starting rating_, _k-factor_, and _xi_ values\n- Support for _n_-sized teams\n- \"Exhibition\" period: first _n_ games can have and adjustment multiplier in order to move a player to their proper rating faster. \n  Other players will get an inverse multiplier.\n\n## Usage\n\nFirst, start a league by creating a league object with the configuration for the league:\n\n```kotlin\nval league = League(kFactorBase = 32, trialKFactorMultiplier = 2)\n```\n\nYou will probably want to persist this information within your application so that you can re-create this object at anytime\n\nNext, build the game information objects:\n\n```kotlin\nval game = Game(\n                id = UUID.randomUUID().toString(),\n                team1Score = 10,\n                team2Score = 0,\n                team1PlayerIds = listOf(player1Id),\n                team2PlayerIds = listOf(player2Id),\n                entryDate = Instant.now())\n```\n\nPlayer ids are an identifier supplied by you. Just make sure that the values are consistent for a given player across all games.\nThen, you can calculate the ratings:\n\n```kotlin\nval output : LeagueState = calculateNewLeague(league = league, games = listOf(game))\n```\n\nview the `LeagueState` class for information on the output.\nTo add more games, you do not need to repeat all of these steps. \nSimply use the previously calculated `LeagueState`:\n\n```kotlin\n val updatedResults : LeagueState = addGameToLeague(leagueState = leagueState, game = newGame)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwakingrufus%2Flib-elo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwakingrufus%2Flib-elo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwakingrufus%2Flib-elo/lists"}