A unified representation of League of Legends-related information.
Project description
LoL Game DTO
A unified Data Transfer Object for League of Legends games. Currently developed by Tolki, FatalElement, and Kalturi.
⚠ This project is still a work in progress and not ready for release yet ⚠
Motivation
League of Legends game information can come in many forms. The most popular source is Riot’s API and in particular its MATCH-V4 endpoint, which defines its own MatchDto and MatchTimelineDto objects. While other sources of information could follow Riot’s data format, requiring multiple objects to represent a single game and being constrained by Riot’s data format is inconvenient.
This is why creating a unique, community-driven representation of League of Legends game data will help communication and teamwork in open source projects. Improving the data structure will also make the data more accessible to new developers, and will make existing libraries easier to maintain.
Constraints
-
Retain all the information present in the Riot API
-
Allow for external information, like role, to be added to the object
-
Be compatible across a wide variety of programming languages
General philosophy
- We try to adhere to the Google JSON Style Guide
- Information is as close as possible to the objects it refers to
- Player-specific information is directly under
playerobjects - Team-wide information is directly under
teamobjects
- Player-specific information is directly under
- Information is not duplicated
winneris only defined once in thegameobject
- Field names are coherent and comply with modern LoL nomenclature
- Every field that is an identifier ends with
id - Fields like
csormonstersKilleduse current game vocabulary (as of June 2020) - All durations from the game start are expressed in seconds
- Every field that is an identifier ends with
null
The null value should only be used for unknown information. The best practice is to not have unknown fields in
the object to keep it as light as possible.
lol_dto
This repository hosts a python reference implementation in the form of a TypedDict.
A TypedDict does not enforce constraints but will raise linter warnings and allows IDEs to autocomplete field names.
Another module focused on transforming MatchDto and MatchTimelineDto to a LolGame can
be found here. Its
unit tests
and JSON examples
are useful sources to better understand the data structure.
LolGame DTO overview
game: dict
├── sources: dict
├── teams: dict
│ ├── bans: list
│ ├── monstersKills: list
│ ├── buildingsKills: list
│ └── players: list
│ ├── uniqueIdentifiers: dict
│ ├── endOfGameStats: dict
│ │ └── items: list
│ ├── summonersSpells: list
│ ├── runes: list
│ ├── snapshots: list
│ ├── itemsEvents: list
│ ├── wardsEvents: list
│ └── skillsEvents: list
└── kills: list
Game
sourcesrepresents unique identifiers for this game for a given data source"riotLolApi": { "gameId": 4409190456, "platformId": "KR" }
teamsis a dictionary with keys equal to'BLUE'or'RED'killsare present directly at the root of thegameobject as they refer to multiple players throughkillerId,victimId, andassistingParticipantsIds- ⚠ This is open to discussion and could be changed before the first release ⚠
- We have to rely on the arbitrary
participantIdgiven by the Riot API because:- Relying on
championIdmakes it incompatible with blind pick - Relying on
inGameNamedoes not work forMatchTimelineobjects from the Riot API
- Relying on
- ⚠
picks_banswill be added in the near future for esports games and will represent the full picks and bans ⚠
Team
bansis a simple list ofidof champions banned by the team.monsterKillsandbuildingKillsare at theteamlevel because they are team-wide- They both define their own
BuildingKillEventandMonsterKillEventDTOs that are very different from Riot’s API
- They both define their own
playersare simply in a list because no unique key arisesrolesare not guaranteed to be defined and unique
Player
idrefers to Riot API’sparticipantIdand is unfortunately necessary to be able to link different objects coming from ituniqueIdentifiersis similar togame['sources']in that it represents a unique identifier for the player in the specified data source"riotLolApi": { "accountId": "3VcaXNMW8jq3adCqG0k0RPBaxoNL08NFXH_h4_2sKI_iEKw", "platformId": "KR" }
endOfGameStatsrepresents statistics that are only available at the end of the game, including end of gameitemsas well askills,totalDamageDealtToChampions, ...snapshotsis a list of timestamped information about the player, mostlygoldandpositionat given timestampsitemsEventsare item-related events from players (buying, selling, undoing, destroying)wardsEventsare ward-related events from players (placing, destroying)skillsLevelUpEventsare skills level up events from players
Contributing
Currently wanted contribution are:
- Feedback about the data structure and field names
- Implementation of the data structure in other programming languages
- C functions to cast Riot API objects to this LolGame DTO as multiple languages can bind to them
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file lol_dto-0.1a7.tar.gz.
File metadata
- Download URL: lol_dto-0.1a7.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c2515d8267dfc6fe01a5d091b1de48b507d08578b9fc72631548308edfe9255
|
|
| MD5 |
652c1b6202ddf76b2455e76ec57c758f
|
|
| BLAKE2b-256 |
753ed6e3b8fa3af240d5b57e7cba18d6fc613335b94099ea5eb92149b248f20d
|