Skip to main content

A free sports API written for python

Project description

https://travis-ci.org/roclark/sportsreference.svg?branch=master Documentation Status

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. 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.

Examples

The following are a few examples showcasing how easy it can be to collect an abundance of metrics and information from all of the tracked leagues. The examples below are only a miniscule subset of the total number of statistics that can be pulled using sportsreference. Visit the documentation on Read The Docs for a complete list of all information exposed by the API.

Get instances of all NHL teams for the 2018 season

from sportsreference.nhl.teams import Teams

teams = Teams(2018)

Get a specific NFL team’s season information

from sportsreference.nfl.teams import Teams

teams = Teams()
lions = teams('DET')

Get a Pandas DataFrame of all stats for a MLB game

from sportsreference.mlb.boxscore import Boxscore

game = Boxscore('BOS201806070')
df = game.dataframe

Documentation

Complete documentation is hosted on readthedocs.org. Refer to the documentation for a full list of all metrics and information exposed by sportsreference. The documentation is auto-generated using Sphinx based on the docstrings in the sportsreference package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sportsreference-0.1.1.tar.gz (124.7 kB view details)

Uploaded Source

Built Distribution

sportsreference-0.1.1-py2.py3-none-any.whl (212.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sportsreference-0.1.1.tar.gz.

File metadata

  • Download URL: sportsreference-0.1.1.tar.gz
  • Upload date:
  • Size: 124.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for sportsreference-0.1.1.tar.gz
Algorithm Hash digest
SHA256 741f4f78a686dfe39f70e4c67babc760c9f590be6fead84c68d98843efcee326
MD5 7a479a46454146f97abf232c54515cc6
BLAKE2b-256 67d25498d71251bf02d78949f1e4f6326b883cbac861fb40bb666daab91a82cf

See more details on using hashes here.

File details

Details for the file sportsreference-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: sportsreference-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 212.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for sportsreference-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 07244f1ad542b9dc2d19bf23d87d9c8a893f322e285a181da06fb0c30528708e
MD5 322efc0cd7ab51763aa127fd45038dd8
BLAKE2b-256 b723f787785d8fd2be6d5b57cf005e0ceefaca7429d5e87f9e207605f24b38a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page