espnff icon indicating copy to clipboard operation
espnff copied to clipboard

Add client for private league authorization

Open fgblomqvist opened this issue 7 years ago • 2 comments

This adds an ESPNFF client that can be used to authorize against the ESPNFF API using username and password. Once authorized, a private league can be fetched.

Usage:

from espnff import ESPNFF

client = ESPNFF('<username>', '<password>')
try:
    client.authorize()
except AuthorizationError:
    print('failed to authorize')

client.get_league('<league_id>', '<year>')

I'll leave it to someone else to document properly in the README.

Side note: This project suffers from a lot of PEP8 errors, so I suggest someone cleans it up (I recommend flake8). There are also a few other things, such as non-closed files during tests and wrong doc notation (should be 3 double quotes, not single quotes). Would clean it up myself but don't wanna do something that will later get rejected in case the repo owner wants things his way :)

fgblomqvist avatar Aug 26 '17 15:08 fgblomqvist

Just an FYI. Now that this grabs the SWID you can use this endpoint to grab all the logged in users fantasy leagues. http://fan.api.espn.com/apis/v2/fans/the_SWID_value?context=fantasy

djk12587 avatar Mar 08 '18 08:03 djk12587

Any chance we could get this through? I've been using the private league client and it's been great, but I'd like to be able to contribute to this project while also using the private league client.

dmrickert avatar Sep 26 '18 03:09 dmrickert