All Projects → MySportsFeeds → mysportsfeeds-python

MySportsFeeds / mysportsfeeds-python

Licence: MIT License
Python wrapper for the MySportsFeeds Sports Data API

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to mysportsfeeds-python

mysportsfeeds-node
NodeJS wrapper for the MySportsFeeds Sports Data API
Stars: ✭ 62 (-19.48%)
Mutual labels:  mlb, nba-stats, sports-stats, sports-data, nhl-api
mysportsfeeds-api
Feature requests for the MySportsFeeds Sports Data API.
Stars: ✭ 44 (-42.86%)
Mutual labels:  mlb, nba-stats, sports-stats, sports-data
mysportsfeeds-r
R wrapper functions for the MySportsFeeds Sports Data API
Stars: ✭ 27 (-64.94%)
Mutual labels:  mlb, nba-stats, sports-stats, sports-data
openrowingmonitor
A free and open source performance monitor for rowing machines
Stars: ✭ 29 (-62.34%)
Mutual labels:  sports-stats, sports-data
boxball
Prebuilt Docker images with Retrosheet's complete baseball history data for many analytical frameworks. Includes Postgres, cstore_fdw, MySQL, SQLite, Clickhouse, Drill, Parquet, and CSV.
Stars: ✭ 79 (+2.6%)
Mutual labels:  sports-stats, sports-data
flask-react-d3-celery
A full-stack dockerized web application to visualize Formula 1 race statistics from 2016 to present, with a Python Flask server and a React front-end with d3.js as data visualization tool.
Stars: ✭ 20 (-74.03%)
Mutual labels:  sports-stats, sports-data
cfbscrapR
A scraping and aggregating package using the CollegeFootballData API
Stars: ✭ 25 (-67.53%)
Mutual labels:  sports-stats, sports-data
whoscored
Football player rating analysis and position recommendation
Stars: ✭ 30 (-61.04%)
Mutual labels:  sports-data
NBA-analytics
Short, offhand analyses of the NBA
Stars: ✭ 37 (-51.95%)
Mutual labels:  nba-stats
public sport science datasets
An ongoing compilation of publicly available datasets for sport science projects.
Stars: ✭ 24 (-68.83%)
Mutual labels:  sports-data
FFDB
NFL Database Engine for PostgreSql and Mongo (easily works with other custom databases too)
Stars: ✭ 34 (-55.84%)
Mutual labels:  nflstats
nhlplaybyplay-node
Fetch and Convert NHL Play by Play game data
Stars: ✭ 13 (-83.12%)
Mutual labels:  nhl-api
LazyMan-iOS
A simple app that lets you stream every live and archived NHL and MLB game from any of your iOS devices.
Stars: ✭ 73 (-5.19%)
Mutual labels:  mlb
NBA-Shot-Charts
Create NBA shot charts using data scrapped from stats.nba.com and R package ggplot2.
Stars: ✭ 33 (-57.14%)
Mutual labels:  nba-stats
worldfootballR
A wrapper for extracting world football (soccer) data from FBref, Transfermark, Understat and fotmob
Stars: ✭ 188 (+144.16%)
Mutual labels:  sports-data
scrapeOP
A python package for scraping oddsportal.com
Stars: ✭ 99 (+28.57%)
Mutual labels:  sports-data
nhl-twitter-bot
🚨 Hockey Game Bot is a Python application that sends important NHL events to social media platforms in (near) real time.
Stars: ✭ 18 (-76.62%)
Mutual labels:  nhl-api
NBA-Machine-Learning-Sports-Betting
NBA sports betting using machine learning
Stars: ✭ 150 (+94.81%)
Mutual labels:  sports-data
nba-stats-client
🏀 JavaScript Client for stats from NBA.com
Stars: ✭ 29 (-62.34%)
Mutual labels:  nba-stats
sports.py
A simple Python package to gather live sports scores
Stars: ✭ 51 (-33.77%)
Mutual labels:  sports-stats

mysportsfeeds-python

MySportsFeeds Python Wrapper brought to you by @MySportsFeeds.

Makes use of the MySportsFeeds API - a flexible, developer-friendly Sports Data API.

Free for Non-Commercial Use.

Install

Clone repo, install requirements and run tests

$ git clone https://github.com/MySportsFeeds/mysportsfeeds-python.git
$ make build

OR

Use PIP install

$ pip install ohmysportsfeedspy

If you haven't signed up for API access, do so here https://www.mysportsfeeds.com

Usage

Create main MySportsFeeds object with API version as input parameter

For v1.x feed requests (free non-commercial access available):

from ohmysportsfeedspy import MySportsFeeds

msf = MySportsFeeds(version="1.2")

For v2.0 feed requests (donation required for non-commercial access):

from ohmysportsfeedspy import MySportsFeeds

msf = MySportsFeeds(version="2.0")

Authenticate for v1.x (uses your MySportsFeeds account password)

msf.authenticate("<YOUR_API_KEY>", "<YOUR_PASSWORD>")

Authenticate for v2.0 (simply uses "MYSPORTSFEEDS" as password)

msf.authenticate("YOUR_API_KEY", "MYSPORTSFEEDS")

Now you can start making requests, specifying: league, season, feed, format, and any other applicable params for the feed

Example (v1.x): Get all NBA 2016-2017 regular season gamelogs for Stephen Curry, in JSON format

    output = msf.msf_get_data(league='nba',season='2016-2017-regular',feed='player_gamelogs',format='json',player='stephen-curry')

Example (v1.x): Get all NFL 2015-2016 regular season seasonal stats totals for all Dallas Cowboys players, in XML format

    output = msf.msf_get_data(league='nfl',season='2015-2016-regular',feed='cumulative_player_stats',format='xml',team='dallas-cowboys')

Example (v1.x): Get full game schedule for the MLB 2016 playoff season, in CSV format

    output = msf.msf_get_data(league='mlb',season='2016-playoff',feed='full_game_schedule',format='csv')

Example (v2.x): Get all NBA 2016-2017 regular season gamelogs for Stephen Curry, in JSON format

    output = msf.msf_get_data(league='nba',season='2016-2017-regular',feed='seasonal_player_gamelogs',format='json',player='stephen-curry')

Example (v2.x): Get full game schedule and scores for the MLB 2016 playoff season, in CSV format

    output = msf.msf_get_data(league='mlb',season='2016-playoff',feed='seasonal_games',format='csv')

Non-successful response codes can be handled using a snippet like below:

try:
    output = msf.get_data(...)
except Warning as e:
    status_code = e.args[1]
    ... # Add logic to handle status codes other than 200 and 304 here

That's it! Returned data is also stored locally under "results/" by default, in appropriately named files.

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