All Projects → roclark → Sportsipy

roclark / Sportsipy

Licence: mit
A free sports API written for python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sportsipy

Csinva.github.io
Slides, paper notes, class notes, blog posts, and research on ML 📉, statistics 📊, and AI 🤖.
Stars: ✭ 342 (+49.34%)
Mutual labels:  artificial-intelligence, statistics, stats
Pypistats
Command-line interface to PyPI Stats API to get download stats for Python packages
Stars: ✭ 86 (-62.45%)
Mutual labels:  api, statistics, stats
Data Science Best Resources
Carefully curated resource links for data science in one place
Stars: ✭ 1,104 (+382.1%)
Mutual labels:  api, artificial-intelligence, statistics
Github Traffic
Get the Github traffic for the specified repository
Stars: ✭ 77 (-66.38%)
Mutual labels:  api, statistics, stats
Tennis Crystal Ball
Ultimate Tennis Statistics and Tennis Crystal Ball - Tennis Big Data Analysis and Prediction
Stars: ✭ 107 (-53.28%)
Mutual labels:  sports, statistics
Npm Stats
📈 npm package statistics dashboard build with vue
Stars: ✭ 106 (-53.71%)
Mutual labels:  statistics, stats
Streaker
🔥 GitHub contribution streak & stat tracking menu bar app
Stars: ✭ 131 (-42.79%)
Mutual labels:  statistics, stats
Flutter app
🔥🔥🔥本项目包括各种基本控件使用(Text、TextField、Icon、Image、Listview、Gridview、Picker、Stepper、Dialog、Slider、Row、Appbar、Sizebox、BottomSheet、Chip、Dismissible、FlutterLogo、Check、Switch、TabBar、BottomNavigationBar、Sliver等)、豆瓣电影、tubitv、每日一文、和天气、百姓生活、随机诗词、联系人、句子迷、好奇心日报、有道精品课、高德定位、音乐播放器🎵、追书神器等板块
Stars: ✭ 2,140 (+834.5%)
Mutual labels:  api, nba
Gameday api
A Ruby API for using the Major League Baseball Gameday statistics data. MLB provides very deep statistics for all major league baseball games through Gameday. Statistics include not only the typical boxscore stats, but also down to the physics of every single pitch thrown in the game. You can find the speed, movement, and position of every pitch thrown. The Gameday API makes it easy for Ruby developers to work with all this statistical information. The test directory included with the source code contains many examples of how the API can be used. If you prefer to use SVN, the gameday_api is also available via an SVN repository at: http://code.google.com/p/gamedayapi/ If you like this project, be sure to also check out the Baseball-Tracker project also hosted on GitHub. Baseball-Tracker is a web application that uses the gameday_api. You can find a hosted version of Baseball Tracker at http://baseballstatz.heroku.com
Stars: ✭ 137 (-40.17%)
Mutual labels:  statistics, stats
Machine Learning With Python
Practice and tutorial-style notebooks covering wide variety of machine learning techniques
Stars: ✭ 2,197 (+859.39%)
Mutual labels:  artificial-intelligence, statistics
Scikit Posthocs
Multiple Pairwise Comparisons (Post Hoc) Tests in Python
Stars: ✭ 186 (-18.78%)
Mutual labels:  statistics, stats
Devstats
📊 A CLI application that fetches stats from developer sites
Stars: ✭ 105 (-54.15%)
Mutual labels:  statistics, stats
Papers Literature Ml Dl Rl Ai
Highly cited and useful papers related to machine learning, deep learning, AI, game theory, reinforcement learning
Stars: ✭ 1,341 (+485.59%)
Mutual labels:  artificial-intelligence, statistics
Foundry
The Cognitive Foundry is an open-source Java library for building intelligent systems using machine learning
Stars: ✭ 124 (-45.85%)
Mutual labels:  artificial-intelligence, statistics
Basketball analytics
Repository which contains various scripts and work with various basketball statistics
Stars: ✭ 88 (-61.57%)
Mutual labels:  nba, sports
Css Analyzer
Analytics for CSS
Stars: ✭ 146 (-36.24%)
Mutual labels:  statistics, stats
Choochoo
Training Diary
Stars: ✭ 186 (-18.78%)
Mutual labels:  sports, statistics
Uci Ml Api
Simple API for UCI Machine Learning Dataset Repository (search, download, analyze)
Stars: ✭ 190 (-17.03%)
Mutual labels:  api, statistics
Stat
Statistics package for Go [DEPRECATED]
Stars: ✭ 198 (-13.54%)
Mutual labels:  statistics, stats
Memcache Info
Simple and efficient way to show information about Memcache.
Stars: ✭ 84 (-63.32%)
Mutual labels:  statistics, stats

Sportsipy: A free sports API written for python ############################################### .. image:: https://github.com/roclark/sportsipy/workflows/Sportsipy%20push%20tests/badge.svg :target: https://github.com/roclark/sportsipy/actions .. image:: https://readthedocs.org/projects/sportsipy/badge/?version=latest :target: https://sportsipy.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status .. image:: https://img.shields.io/pypi/v/sportsipy.svg :target: https://pypi.org/project/sportsipy

.. contents::

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

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

Installation

The easiest way to install sportsipy is by downloading the latest released binary from PyPI using PIP. For instructions on installing PIP, visit PyPA.io <https://pip.pypa.io/en/stable/installing/>_ for detailed steps on installing the package manager for your local environment.

Next, run::

pip install sportsipy

to download and install the latest official release of sportsipy on your machine. You now have the latest stable version of sportsipy installed and can begin using it following the examples below!

If the bleeding-edge version of sportsipy is desired, clone this repository using git and install all of the package requirements with PIP::

git clone https://github.com/roclark/sportsipy
cd sportsipy
pip install -r requirements.txt

Once complete, create a Python wheel for your default version of Python by running the following command::

python setup.py sdist bdist_wheel

This will create a .whl file in the dist directory which can be installed with the following command::

pip install dist/*.whl

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 sportsipy. Visit the documentation on Read The Docs <http://sportsipy.readthedocs.io/en/latest/>_ for a complete list of all information exposed by the API.

Get instances of all NHL teams for the 2018 season

.. code-block:: python

from sportsipy.nhl.teams import Teams

teams = Teams(2018)

Print every NBA team's name and abbreviation

.. code-block:: python

from sportsipy.nba.teams import Teams

teams = Teams()
for team in teams:
    print(team.name, team.abbreviation)

Get a specific NFL team's season information

.. code-block:: python

from sportsipy.nfl.teams import Teams

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

Print the date of every game for a NCAA Men's Basketball team

.. code-block:: python

from sportsipy.ncaab.schedule import Schedule

purdue_schedule = Schedule('purdue')
for game in purdue_schedule:
    print(game.date)

Print the number of interceptions by the away team in a NCAA Football game

.. code-block:: python

from sportsipy.ncaaf.boxscore import Boxscore

championship_game = Boxscore('2018-01-08-georgia')
print(championship_game.away_interceptions)

Get a Pandas DataFrame of all stats for a MLB game

.. code-block:: python

from sportsipy.mlb.boxscore import Boxscore

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

Find the number of goals a football team has scored

.. code-block:: python

from sportsipy.fb.team import Team

tottenham = Team('Tottenham Hotspur')
print(tottenham.goals_scored)

Documentation

Two blog posts detailing the creation and basic usage of sportsipy can be found on The Medium at the following links:

  • Part 1: Creating a public sports API <https://medium.com/clarktech-sports/python-sports-analytics-made-simple-part-1-14569d6e9a86>_
  • Part 2: Pull any sports metric in 10 lines of Python <https://medium.com/clarktech-sports/python-sports-analytics-made-simple-part-2-40e591a7f3db>_

The second post in particular is a great guide for getting started with sportsipy and is highly recommended for anyone who is new to the package.

Complete documentation is hosted on readthedocs.org <http://sportsipy.readthedocs.io/en/latest>_. Refer to the documentation for a full list of all metrics and information exposed by sportsipy. The documentation is auto-generated using Sphinx based on the docstrings in the sportsipy package.

Testing

Sportsipy contains a testing suite which aims to test all major portions of code for proper functionality. To run the test suite against your environment, ensure all of the requirements are installed by running::

pip install -r requirements.txt

Next, start the tests by running py.test while optionally including coverage flags which identify the amount of production code covered by the testing framework::

py.test --cov=sportsipy --cov-report term-missing tests/

If the tests were successful, it will return a green line will show a message at the end of the output similar to the following::

======================= 380 passed in 245.56 seconds =======================

If a test failed, it will show the number of failed and what went wrong within the test output. If that's the case, ensure you have the latest version of code and are in a supported environment. Otherwise, create an issue on GitHub to attempt to get the issue resolved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].