Open Source Sports Analytics

Card image

balaban

A small Python package for estimating & plotting Bayesian hierarchical models for player-level soccer data. The basic goal of balaban is to improve the modelling of uncertainty in common player-level metrics (e.g., pass completion percentages, goals per 90, xG per shot, xA per 90). This is done through Bayesian hierarchical models for the 4 most common types of metric:

Sport(s): Soccer

Creator(s): anenglishgoat

Platform(s): Python

License: AGPL-3

Visit Page
Card image

ballR

An R API for basketball-reference.com. The correct pronounciation for this package is baw-ler.

Sport(s): Basketball

Creator(s): Ryan Elmore

Platform(s): R

License: None

Visit Page
Card image

baseballR

baseballr is a package written for R focused on baseball analysis. It includes functions for scraping various data from websites, such as FanGraphs.com, Baseball-Reference.com, and baseballsavant.com. It also includes functions for calculating metrics, such as wOBA, FIP, and team-level consistency over custom time frames.

Sport(s): Baseball

Creator(s): Bill Petti

Platform(s): R

License: None

Visit Page
Card image

BaseballRstats

Exploring baseball statistics with R.

Sport(s): Baseball

Creator(s): Baseball with R

Platform(s): R

License: None

Visit Page
Card image

Basketball Analytics

Repository with various notebooks showcasing examples of analyzing and visualizing NBA data

Sport(s): Basketball

Creator(s): Daniel Bratulić

Platform(s): Python

License: MIT

Visit Page
Card image

bigballR

bigballR is an R package for working with NCAA Basketball data. This package primarily revolves around the use of schedule, roster, and play-by-play data via stats.ncaa.com, and additionally has features to calculate lineups, on/off results, and player game and multi-game statistics.

Sport(s): Basketball

Creator(s): Jake Flancer

Platform(s): R

License: None

Visit Page
Card image

cfbscrapR

cfbscrapR is an R package for working with CFB data. It is an R API wrapper around https://collegefootballdata.com/. It provides users the capability to get a plethora of endpoints, and supplement that data with additional information (Expected Points Added/Win Probability added)

Sport(s): American Football

Creator(s): Meyappan Saiem Gilani Parker

Platform(s): R

License: GPL-3.0

Visit Page
Card image

CFBScrapy

Python wrapper for the collegefootballapi located here: https://api.collegefootballdata.com/api/docs/?url=/api-docs.json#/

Sport(s): American Football

Creator(s): Ryan Lindholm

Platform(s): Python

License: None

Visit Page
Card image

CodaBonito

Functions to aid football / soccer analysis

Sport(s): Soccer

Creator(s): The Come On Man

Platform(s): R

License: MIT License

Visit Page
Card image

collegeballR

College sports. This R package provides easy access to college sports (NCAA) data via stats.ncaa.org. Note if you are trying to get baseball data, I would look at Bill Petti's baseballr pkg.

Sport(s): American Football

Creator(s): Meyappan

Platform(s): R

License: None

Visit Page
Card image

cricketdata

Functions for Downloading Cricket Data from ESPNCricinfo Data on all international cricket matches is provided by ESPNCricinfo. This package provides some scraper functions to download the data into tibbles ready for analysis.

Sport(s): Cricket

Creator(s): rOpenSci Labs

Platform(s): R

License: None

Visit Page
Card image

cricketr

This R package can be used to analyze performances of cricketers based on stats from ESPN Cricinfo.

Sport(s): Cricket

Creator(s): Tinniam V Ganesh

Platform(s): R

License: None

Visit Page
Card image

Dato Fútbol

The main repository of the project "Dato Fútbol" which is focused on to do data science in the field of Football (Soccer) Analytics using R

Sport(s): Soccer

Creator(s): Ismael Gómez

Platform(s): R

License: None

Visit Page
Card image

elite

This is a package for scraping hockey data from EliteProspects in a [fairly] tidy manner for the purpose of analysis

Sport(s): Ice Hockey

Creator(s): Evan Oppenheimer

Platform(s): R

License: None

Visit Page
Card image

eLPAR-soccer

This repository includes all the code and data used for developing the expected league points above replacement for soccer as described in "Positional Value in Soccer: Expected League Points Added above Replacement".

Sport(s): Soccer

Creator(s): Kostas

Platform(s): R

License: None

Visit Page
Card image

engsoccerdata

This R package is mainly a repository for complete soccer datasets, along with some built-in functions for analyzing parts of the data. Currently I include three English ones (League data, FA Cup data, Playoff data - described below), several European leagues (Spain, Germany, Italy, Holland, France, Belgium, Portugal, Turkey, Scotland, Greece) as well as South Africa and MLS.

Sport(s): Soccer

Creator(s): James Curley

Platform(s): R

License: GPL-3.0

Visit Page
Card image

espnscrapeR

The goal of espnscrapeR is to collect or scrape QBR, NFL standings, and stats from ESPN.

Sport(s): American Football

Creator(s): Thomas Mock

Platform(s): R

License: None

Visit Page
Card image

evolving-hockey

The sc.scrape_pbp function is used to scrape one or more games from the NHL's publicly available data.

Sport(s): Ice Hockey

Creator(s): EvolvingWild

Platform(s): R

License: GPL-3.0

Visit Page
Card image

fc.rstats

A package with various functions that help people working with OPTA and ChyronHego data, this will be a regularly updated with new functions. Installed via:

Sport(s): Soccer

Creator(s): FC_rSTATS

Platform(s): R

License: None

Visit Page
Card image

fcscrapR

The goal of fcscrapR is to allow R users quick access to the commentary for each soccer game available on ESPN. The commentary data includes basic events such as shot attempts, substitutions, fouls, cards, corners, and video reviews along with information about the players involved. The data can be accessed in-game as ESPN updates their match commentary. This package was created to help get data in the hands of soccer fans to do their own analysis and contribute to reproducible metrics.

Sport(s): Soccer

Creator(s): Ron Yurko

Platform(s): R

License: None

Visit Page
Card image

fitzRoy

The goal of fitzRoy is to provide a set of functions that allows for users to easily get access to AFL data from sources such as http://afltables.com and http://footywire.com.

Sport(s): Australian Football

Creator(s): James Day

Platform(s): R

License: None

Visit Page
Card image

football-packing

Calculate the packing metric for a given pass

Sport(s): Soccer

Creator(s): Samira Kumar

Platform(s): Python

License: MIT License

Visit Page
Card image

footballdatr

The goal of footballdatr is to enable easy use of football-data.co.uk data within R.

Sport(s): Soccer

Creator(s): Ben Torvaney

Platform(s): R

License: None

Visit Page
Card image

footballR

footballR is an R package that calls various free football (soccer) APIs.

Sport(s): Soccer

Creator(s): David Sheehan

Platform(s): R

License: MIT License

Visit Page
Card image

GeomMLBStadiums

This package defines a couple of Geoms to draw MLB stadiums in ggplot2. It also provides a Geom to draw a "spraychart" - x and y locations of batted balls with a stadium overlay.

Sport(s): Baseball

Creator(s): Ben Dilday

Platform(s): R

License: None

Visit Page
Card image

ggsoccer

ggsoccer provides a handful of functions that make it easy to plot soccer event data in R/ggplot2.

Sport(s): Soccer

Creator(s): Ben Torvaney

Platform(s): R

License: None

Visit Page
Card image

Goalmodel

Prediction models for the number of goals scored in sport games.

Sport(s): Ice Hockey, Basketball, American Football, Baseball, Soccer

Creator(s): Jonas

Platform(s): R

License: GPL-3

Visit Page
Card image

hockey-all

All things hockey related

Sport(s): Ice Hockey

Creator(s): EvolvingWild

Platform(s): R

License: None

Visit Page
Card image

hockey_scraper

This package is designed to allow people to scrape both NHL data

Sport(s): Ice Hockey

Creator(s): Harry Shomer

Platform(s): Python

License: GPL-3.0

Visit Page
Card image

kloppy

Standardizing soccer tracking- and event data

Sport(s): Soccer

Creator(s): Koen Vossen

Platform(s): Python

License: BSD 3-Clause

Visit Page
Card image

L2M

This repository is meant as a way to maintain the Last Two Minute (L2M) reports that the NBA releases for certain NBA games

Sport(s): Basketball

Creator(s): atlhawksfanatic

Platform(s): R

License: MIT

Visit Page
Card image

Lahman

This database contains pitching, hitting, and fielding statistics for Major League Baseball from 1871 through 2012. As an R package, it offers a variety of interesting challenges and opportunities for data processing and visualization in R.

Sport(s): Baseball

Creator(s): Sean Lahman

Platform(s): R

License: GPL-3.0

Visit Page
Card image

LaurieOnTracking

Laurie's code for reading and working with Metrica's tracking and event data in soccer.

Sport(s): Soccer

Creator(s): Laurie Shaw

Platform(s): Python

License: None

Visit Page
Card image

mlbgame

mlbgame is a Python API to retrieve and read MLB GameDay data. mlbgame works with real time data, getting information as games are being played.

Sport(s): Baseball

Creator(s): Zach Panzarino

Platform(s): Python

License: MIT License

Visit Page
Card image

mlbgameday

Designed to facilitate extract, transform and load for MLBAM “Gameday” data. The package is optimized for parallel processing of data that may be larger than memory. There are other packages in the R universe that were built to perform statistics and visualizations on these data, but mlbgameday is concerned primarily with data collection. More uses of these data can be found in the pitchRx, openWAR, and baseballr packages.

Sport(s): Baseball

Creator(s): Kris Eberwein

Platform(s): R

License: None

Visit Page
Card image

mplsoccer

Library for drawing soccer/football pitches in Matplotlib and loading StatsBomb open-data

Sport(s): Soccer

Creator(s): Andy Rowlinson

Platform(s): Python

License: MIT License

Visit Page
Card image

nba_parser

Package to calculate nba stats from a play by play file

Sport(s): Basketball

Creator(s): Matthew Barlowe

Platform(s): Python

License: GPLv3

Visit Page
Card image

nba_scraper

This is a package written in Python to scrape the NBA's api and produce the play by play of games either in a csv file or a pandas dataframe. This package has two main functions scrape_game which scrapes an individual game or a list of specific games, and scrape_season which scrapes an entire season of regular season games. The scraper goes back to the 1999-2000 season and will pull the play by play along with who was on the court at the time of each play. Some other various statistics may be calculated as well.

Sport(s): Basketball

Creator(s): Matthew Barlowe

Platform(s): Python

License: GPL-3.0

Visit Page
Card image

nbastatR

A package to help you master the NBA data universe in R. Wrappers: NBA Stats API, Basketball-Reference, HoopsHype, nbadraft.net, realgm, Basketball Insiders

Sport(s): Basketball

Creator(s): Alex Bresler

Platform(s): R

License: None

Visit Page
Card image

ncaahoopR

ncaahoopR is an R package for working with NCAA Basketball Play-by-Play Data. It scrapes play-by-play data and returns it to the user in a tidy format and allows the user to explore the data with assist networks, shot charts, and in-game win-probability charts.

Sport(s): Basketball

Creator(s): Luke Benz

Platform(s): R

License: MIT License

Visit Page
Card image

nfldb

nfldb is a relational database bundled with a Python module to quickly and conveniently query and update the database with data from active games. THIS PROJECT IS UNMAINTAINED.

Sport(s): American Football

Creator(s): Andrew Gallant

Platform(s): Python

License: UNLICENSE

Visit Page
Card image

nflfastR

nflfastR is a set of functions to efficiently scrape NFL play-by-play data

Sport(s): American Football

Creator(s): Sebastian Carl Ben Baldwin

Platform(s): R

License: MIT License

Visit Page
Card image

nflscrapR

NFL play-by-play data-

Sport(s): American Football

Creator(s): Maksim Horowitz Ron Yurko Sam Ventura Rishav Dutta

Platform(s): R

License: None

Visit Page
Card image

nhlapi

{nhlapi} is an R package that provides functionality to retrieve and process the data exposed by the open 'NHL' API. This includes information on players, teams, games, tournaments, drafts, standings, schedules and other endpoints.

Sport(s): Ice Hockey

Creator(s): Jozef Hajnala

Platform(s): R

License: GPL-3.0

Visit Page
Card image

nhlscrape

A package for scraping the nhl API and HTML reports to build a database. Can be used to generate statistics from the information pulled.

Sport(s): Ice Hockey

Creator(s): Adam Azoula

Platform(s): R

License: None

Visit Page
Card image

nwhlR

nwhlR is an R package for working with NWHL play-by-play data. This package can be used to scrape play by play data from the NWHL website, and additionally compile the data into player and team summaries.

Sport(s): Ice Hockey

Creator(s): Jake Flancer

Platform(s): R

License: None

Visit Page
Card image

nwslR

Datasets and Analytics for the National Women's Soccer League (NWSL)

Sport(s): Soccer

Creator(s): Arielle Dror Sophia Tannir Baumer

Platform(s): R

License: GPL-3.0

Visit Page
Card image

openWAR

This package is designed to present a reference implementation of Wins Above Replacement (WAR) for Major League Baseball (MLB) players.

Sport(s): Baseball

Creator(s): Ben Baumer

Platform(s): R

License: None

Visit Page
Card image

pitchRx

Tools for Acquiring MLBAM Gameday data and Visualizing PITCHf/x

Sport(s): Baseball

Creator(s): Carson Sievert

Platform(s): R

License: None

Visit Page
Card image

py-Goldsberry

A Python Package for easily acquiring NBA Data for analysis.

Sport(s): Basketball

Creator(s): Bradley Fay

Platform(s): Python

License: MIT License

Visit Page
Card image

py_ball

Python API wrapper for http://stats.nba.com with a focus on NBA and WNBA applications

Sport(s): Basketball

Creator(s): py_ball(Patrick McFarlane)

Platform(s): Python

License: MIT License

Visit Page
Card image

PyBall

PyBall - A MLB.com Stats API Python Client

Sport(s): Baseball

Creator(s): Brad Hurley

Platform(s): Python

License: MIT License

Visit Page
Card image

pybaseball

pybaseball is a Python package for baseball data analysis. This package scrapes Baseball Reference, Baseball Savant, and FanGraphs so you don't have to. The package retrieves statcast data, pitching stats, batting stats, division standings/team records, awards data, and more. Data is available at the individual pitch level, as well as aggregated at the season level and over custom time periods. See the docs for a comprehensive list of data acquisition functions.

Sport(s): Baseball

Creator(s): James LeDoux

Platform(s): Python

License: MIT License

Visit Page
Card image

pybbda

pybbda is a package for Python Baseball Data and Analysis. The data sources it currently supports are: Lahman data Baseball Reference WAR Fangraphs leaderboards and park factors Retrosheet event data Statcast pitch-by-pitch data

Sport(s): Baseball

Creator(s): Ben Dilday

Platform(s): Python

License: GPL-2.0

Visit Page
Card image

regista

regista is a package for performing some of the common modelling tasks in soccer analytics.

Sport(s): Soccer

Creator(s): Ben Torvaney

Platform(s): R

License: None

Visit Page
Card image

retro

An R package for creating a Retrosheet database using the ETL framework

Sport(s): Baseball

Creator(s): Ben Baumer

Platform(s): R

License: None

Visit Page
Card image

soccer-xg

A Python package for training and analyzing expected goals (xG) models in soccer.

Sport(s): Soccer

Creator(s): DTAI - KU Leuven

Platform(s): Python

License: Apache License, Version 2.0

Visit Page
Card image

soccer_ggplots

Animate goals, Visualize stats, Video analyses, etc. from the World Cup, Premier League, Copa America, and beyond. (Using ggplot2, ggsoccer, and more)

Sport(s): Soccer

Creator(s): Ryo Nakagawara

Platform(s): R

License: GPL-3.0

Visit Page
Card image

socceraction

Convert existing soccer event stream data to SPADL and value player actions

Sport(s): Soccer

Creator(s): Tom Decroos Lotte Bransen Jan van Haaren Jesse Davis

Platform(s): Python

License: MIT License

Visit Page
Card image

soccergraphR

The soccergraphR library is designed for all those who work with OPTA data

Sport(s): Soccer

Creator(s): Jesús Lagos

Platform(s): R

License: GPL-2.0

Visit Page
Card image

soccermatics

Soccermatics provides tools to visualise spatial tracking and event data from football (soccer) matches

Sport(s): Soccer

Creator(s): Joe Gallagher

Platform(s): R

License: None

Visit Page
Card image

soccerplots

A Python package that can be used for making visualisations for football analytics.

Sport(s): Soccer

Creator(s): Anmol Durgapal

Platform(s): Python

License: MIT License

Visit Page
Card image

Sportsreference

Sportsreference is a free python API that pulls the stats from www.sports-reference.com and allows them to be easily be used in python-based applications, especially ones involving data analytics and machine learning. Sportsreference exposes a plethora of sports information from major sports leagues in North America, such as the MLB, NBA, College Football and Basketball, NFL, and NHL. Sportsreference also now supports Professional Football (or Soccer) for thousands of teams from leagues around the world. Every sport has its own set of valid API queries ranging from the list of teams in a league, to the date and time of a game, to the total number of wins a team has secured during the season, and many, many more metrics that paint a more detailed picture of how a team has performed during a game or throughout a season.

Sport(s): Ice Hockey, Basketball, American Football, Baseball, Soccer

Creator(s): Robert Clark

Platform(s): Python

License: MIT License

Visit Page
Card image

statsbomb-parser

Convert competitions/matches/lineups/events JSON data released by StatsBomb into easy-to-use CSV format.

Sport(s): Soccer

Creator(s): Imran Khan

Platform(s): Python

License: MIT License

Visit Page
Card image

statsbombapi

Statsbomb API with Dataclasses

Sport(s): Soccer

Creator(s): Ben Torvaney

Platform(s): Python

License: GPL-3.0

Visit Page
Card image

statsbombpy

This repository is a Python package to easily stream StatsBomb data into Python

Sport(s): Soccer

Creator(s): StatsBomb

Platform(s): Python

License: None

Visit Page
Card image

StatsBombR

This repository is an R package to easily stream StatsBomb data into R

Sport(s): Soccer

Creator(s): StatsBomb

Platform(s): R

License: None

Visit Page
Card image

tyrone_mings

Scraper for transfermarkt

Sport(s): Soccer

Creator(s): FC Rstats

Platform(s): Python

License: None

Visit Page
Card image

understatr

An R package to help with retrieving tidy understat data.

Sport(s): Soccer

Creator(s): Ewen

Platform(s): R

License: MIT License

Visit Page
Card image

wncaahoopR

wncaahoopR is an R package for working with women's NCAA Basketball play-by-play (and other) data. This package relies heavily on the work done by Luke Benz (lbenz730) in his package ncaahoopR, designed for working with men's NCAA basketball play-by-play data. wncaahoopR also scrapes data from ESPN, but differs in that it does not have scraping provided in multiple functions, choosing to only scan in the data once and then makes use of that pbp object within R to produce win-probability and game flow charts, as well as assist networks.

Sport(s): Basketball

Creator(s): Scott Nestler Seth Berry

Platform(s): R

License: MIT License

Visit Page
Card image

xflscrapR

xflscrapR is a R project (and eventual package) by to scrape data from stats.xfl.com and process it into a usable format. Unlike nflscrapR, which is able to directly access play-by-play data in JSON format, the XFL's data is only available in web form.

Sport(s): American Football

Creator(s): Caio Brighenti Keegan A

Platform(s): R

License: None

Visit Page
Card image

yorkr

This R package can be used to analyze performances of cricketers based on match data from Cricsheet. The yorkr package can handle match data from ODIs, Twenty20s and IPL T20s from Cricsheet. The data has to be in yaml format

Sport(s): Cricket

Creator(s): Tinniam V Ganesh

Platform(s): R

License: None

Visit Page