MCPcopy Index your code
hub / github.com/cwendt94/espn-api

github.com/cwendt94/espn-api @v017.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v017.0 ↗ · + Follow
285 symbols 895 edges 70 files 80 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

codecov Join the chat at https://gitter.im/ff-espn-api/community PyPI version

ESPN API

[NOTICE] Username and password will be removed soon. You can access your private league using SWID and ESPN_S2.

This package uses ESPN's Fantasy API to extract data from any public or private league for Fantasy Football and Basketball (Hockey and Baseball in development).
Please feel free to make suggestions, bug reports, and pull request for features or fixes!

This package was inspired and based off of rbarton65/espnff.

Installing

With Git:

git clone https://github.com/cwendt94/espn-api
cd espn-api
python3 setup.py install

With pip:

pip install espn_api

Usage

For Getting Started and API details head over to the Wiki!

# Football API
from espn_api.football import League
# Basketball API
from espn_api.basketball import League
# Hockey API
from espn_api.hockey import League
# Baseball API
from espn_api.baseball import League
# Init
league = League(league_id=222, year=2019)

Run Tests

python3 setup.py nosetests

Discussions (new)

If you have any questions about the package, ESPN API data, or want to talk about a feature please start a discussion!

Issue Reporting

If you find a bug follow the steps below for reporting.

  1. Open a new issue with a brief description of the bug for the title. In the title also add which sport (Football or Basketball)

  2. Run the application in debug mode to view ESPN API request's and response's python # ... import statement above league = League(league_id=1245, year=2019, debug=True) The application will print all requests and the response from ESPN's API in the console. I would suggest piping the console output to a text file as it will be a lot of data.

  3. Find the last log before the crash and copy it in the issue descrption with the line number of the crash or possible bug.

  4. Submit the new issue!

I will try to comment on the issue as soon as possible with my thoughts and possible fix!

Core symbols most depended-on inside this repo

get
called by 107
espn_api/requests/espn_requests.py
league_get
called by 21
espn_api/requests/espn_requests.py
json_parsing
called by 14
espn_api/baseball/utils.py
json_parsing
called by 8
espn_api/football/utils.py
box_scores
called by 8
espn_api/hockey/league.py
_get_pro_schedule
called by 7
espn_api/base_league.py
json_parsing
called by 7
espn_api/utils/utils.py
scoreboard
called by 7
espn_api/hockey/league.py

Shape

Method 211
Class 47
Route 15
Function 12

Languages

Python100%

Modules by API surface

tests/hockey/unit/test_league.py26 symbols
tests/football/unit/test_league.py24 symbols
espn_api/football/league.py21 symbols
espn_api/hockey/league.py11 symbols
espn_api/basketball/league.py11 symbols
espn_api/requests/espn_requests.py10 symbols
espn_api/baseball/league.py10 symbols
espn_api/baseball/box_score.py10 symbols
tests/football/unit/test_past_league.py8 symbols
tests/football/integration/test_league.py8 symbols
tests/espn_requests/test_espn_requests.py8 symbols
espn_api/base_league.py8 symbols

For agents

$ claude mcp add espn-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact