Python Sports Analytics Made Simple (Part 2)

Robert Clark
Clarktech Sports
Published in
10 min readMar 3, 2019

--

Photo by Timur Saglambilek from Pexels

Python Sports Analytics Made Simple (Part 1) — Creating a public sports API

Python Sports Analytics Made Simple (Part 2) — Pull any sports metric in 10 lines of Python

Welcome to this two-part series where I demonstrate how to pull thousands of sports metrics with just a few lines of Python.

In the first part, I detailed the steps I took to create a public API called sportsreference. In this second article, I dive into the installation and usage of the API and demonstrate how easy it can be to pull various sports statistics.

Try to avoid dependency hell at all costs. Photo by icon0.com from Pexels

Setup

Prerequisites

Prior to installing sportsreference, the following prerequisites are required for your development environment:

  • Python 2.7 or Python ≥ 3.5
  • PIP ≥ 8.1.2

Recommendations

In addition to the requirements above, it is also highly recommended to use a virtualenv for development work to avoid what is affectionately known as “dependency hell”.

Dependency hell is a colloquial term for the…

--

--

Robert Clark
Clarktech Sports

Software engineer passionate about sports and artificial intelligence and, apparently, a blogger by night.