Using ESPN's Fantasy Football private API, this package interfaces with ESPN Fantasy Football to gather data from any public league. A good way to mine data without webscraping for data manipulation projects.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
With pip:
pip3 install espnff
With Git:
git clone https://github.com/rbarton65/espnff
cd espnff
python3 setup.py install
This gives an overview of all the features of espnff
>>> from espnff import League
>>> league_id = 123456
>>> year = 2016
>>> league = League(league_id, year)
>>> league
League 123456, 2016 Season
>>> from espnff import League
>>> league_id = 123456
>>> year = 2016
>>> league = League(league_id, year)
>>> league.teams
[Team 1, Team 2, Team 3, Team 4, Team 5, Team 6, Team 7, Team 8]
>>> team1 = league.teams[0]
>>> team1
Team 1
>>> league.teams
[Team 1, Team 2, Team 3, Team 4, Team 5, Team 6, Team 7, Team 8]
>>> team1 = league.teams[0]
>>> team1.team_id
1
>>> team1.team_name
Team 1
>>> team1.team_abbrev
T1
>>> team1.owner
Roger Goodell
>>> team1.division_id
0
>>> team1.division_name
Division 1
>>> team1.wins
5
>>> team1.losses
1
>>> team1.points_for
734.69
>>> team1.points_against
561.15
>>> team1.schedule
[Team 2, Team 3, Team 4, Team 5, Team 6, Team 7, Team 8, Team 2, Team 3, Team 4, Team 5, Team 6, Team 7, Team 8]
>>> team1.scores
[135.5, 126.38, 129.53, 126.65, 114.81, 101.82, 1.15, 0, 0, 0, 0, 0, 0]
>>> team1.mov
[32.12, 24.92, 45.97, 34.17, 41.74, -5.39, 1.15, 0, 0, 0, 0, 0, 0]
>>> from espnff import League
>>> league_id = 123456
>>> year = 2016
>>> league = League(league_id, year)
>>> league.power_rankings(week=5)
[('31.85', Team 1), ('25.60', Team 3), ('25.60', Team 6), ('22.45', Team 2),
('20.70', Team 8), ('18.20', Team 7), ('18.20', Team 4), ('18.10', Team 5)]
Automated tests for this package are included in the tests
directory. After installation,
you can run these tests by changing the directory to the espnff
directory and running the following:
python3 setup.py test
This library uses SemVer for versioning. For available versions, see the tags on this repository