Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.67 KB

README.md

File metadata and controls

40 lines (29 loc) · 1.67 KB

matchday Build Status Coverage Status

matchday is a Node.js module that calculates the approximate probabilities of potential team standings in football (soccer) leagues after a certain period of time.

Installation

You can install matchday from NPM with npm i -S matchday.

Usage

When running matchday, specify the league code, the number of days to look ahead, and, optionally, the amount of times to run the random sampler:

const matchday = require('matchday');

matchday('PREMIER', 7, 1000000).then(standings => {
    // do stuff
});

Currently supported leagues are:

League Code
British Premier League PREMIER
Campeonato Brasileiro Série A BRASILEIRAO

Output schema

The value of the Promise is a Map of team standings to probabilities. A team standing is an array of objects of the following form:

{
    "team": "Manchester City", // the name of the team
    "goalDiff": 79, // the goal difference
    "points": 100 // the amount of points that the team has
}

The team standings are keys of the Map, and so are in text form as JSON. The value of each standing key is its approximate probability, as calculated by the sampler.

Known issues

Note that this project is very new and probably quite buggy. There is a known issue where there is a socket hang up after processing a large number of samples.