GithubHelp home page GithubHelp logo

hkyplyr / yfantasy-api Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 3.0 186 KB

Python API client that can be used to make calls to the Yahoo! Fantasy Sports API. Developed specifically for NHL, but should support the NFL, MLB, and NBA as well.

Home Page: https://pypi.org/project/yfantasy-api/

License: MIT License

Python 100.00%
fantasy-sports hockey football baseball basketball fantasy-hockey fantasy-football

yfantasy-api's People

Contributors

hkyplyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yfantasy-api's Issues

json.decoder.JSONDecodeError: Extra data On Authentication

self.__set_tokens()

File "/home/cfrugard/.local/lib/python3.6/site-packages/yfantasy_api/api/auth.py", line 93, in __set_tokens
self.__load_tokens()
File "/home/cfrugard/.local/lib/python3.6/site-packages/yfantasy_api/api/auth.py", line 99, in __load_tokens
loaded_tokens = json.loads(f.read())
File "/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 1138 (char 1137)

Getting asked for a "code"

How does one configure the "code"?

>>> api = YahooFantasyApi(l, game)
https://api.login.yahoo.com/oauth2/request_auth?redirect_uri=oob&response_type=code&language=en-us
Enter code: 76f478fe82dcdf88c8b2de3d5dc283374a80ea04
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cfrugard/.local/lib/python3.6/site-packages/yfantasy_api/api/api.py", line 45, in __init__
    self.auth_service = AuthenticationService()
  File "/home/cfrugard/.local/lib/python3.6/site-packages/yfantasy_api/api/auth.py", line 51, in __init__
    self.__set_tokens()
  File "/home/cfrugard/.local/lib/python3.6/site-packages/yfantasy_api/api/auth.py", line 95, in __set_tokens
    self.__get_tokens()
  File "/home/cfrugard/.local/lib/python3.6/site-packages/yfantasy_api/api/auth.py", line 108, in __get_tokens
    self.__access_token = requested_tokens[ACCESS_TOKEN]
KeyError: 'access_token'

Fix attribute types for all of the models

Not all of the attributes for the various models are properly typed (str instead of int or float). Go through all of the models to make sure the data is converted properly.

Example: DraftPick.round is returned as a str but should be an int

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.