Coder Social home page Coder Social logo

fantasydata-python's Introduction

fantasydata-python

A Python wrapper around the Fantasy Data API.

Currently support V3 of the FantasyData API.

Example Usage

from fantasy_data.FantasyData import FantasyData
fantasy_data = FantasyData("my_api_key")
player = fantasy_data.get_player(732)
print player
{u'InjuryStartDate': None, u'FirstName': u'Matt', u'PlayerID': 732, u'LastName': u'Ryan',  ....}

Supported Methods

Not all of the FantasyData API is implemented yet. Pull requests welcome!

NFL

  • get_upcoming_season()
  • get_schedules_for_season(season, season_type="REG")
  • get_free_agents()
  • get_current_week()
  • get_team_roster_and_depth_charts(team_name)
  • get_players_game_stats_for_season_for_week(season, week, season_type="REG")
  • get_teams_active()
  • get_player(player_id)
  • get_projected_player_game_stats_by_player(season, week, player_id)
  • get_projected_player_game_stats_by_team(season, week, team)
  • get_projected_player_game_stats_by_week(season, week)
  • get_projected_fantasy_defense_game_stats_by_week(season, week)
  • get_player_season_projected_stats(season)
  • get_fantasy_defense_projections_by_season(season)
  • get_rotoballer_premium_news()
  • get_rotoballer_premium_news_by_date(date)
  • get_rotoballer_premium_news_by_player(player_id)
  • get_rotoballer_premium_news_by_team(team)
  • get_injuries(season, week)
  • get_injuries_by_team(season, week, team)
  • get_box_score_by_team(season, week, team)
  • get_bye_weeks(season)

NBA

  • get_current_season()
  • get_games_by_season(season)
  • get_games_by_date(game_date)
  • get_players_game_stats_by_date(game_date)
  • get_team_game_stats_by_date(game_date)
  • get_standings(season)
  • get_teams_active()

Run tests

To run tests, set an environment variable named FANTASYDATA_API_KEY like this:

export FANTASYDATA_API_KEY=yourapikeyhere

and for NBA tests:

export FANTASYDATA_NBA_API_KEY=yourapikeyhere

Then run the tests with:

python setup.py test

or for python 3:

python3 setup.py test

fantasydata-python's People

Contributors

kday avatar mfa avatar ipolyakov avatar

Stargazers

Donnie Laur avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.