-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Baseball Implementation #195
Comments
Looking to possibly use this! |
|
Hello. When trying to initialize the league I get a keyerror 0. I searched through some previous issues, didn't see anything similar. Any advice? Thank you in advance. I have tried to use the API with your test league from the implementation ticket and I got it to work! But when I try my league info I the KeyError. |
@tomrulz thanks for reporting this! I found the issue, the team object was trying to map stats which has not been added yet for baseball. Package version v0.14.1 has the fix! |
you the man! |
Is there still going to be baseball implementation eventually? Very interested! |
There is already some basic baseball features implemented that you can use for one of your old leagues. The wiki still needs to be updated but you can check out the available functions in the code here. Initialization is like the other leagues from espn_api.baseball import League
league = League(league_id: int, year: int, espn_s2: str = None, swid: str = None, username: str = None, password: str = None, debug=False) Some of the available features are |
Hey @cwendt94 . I've really been enjoying playing around with the baseball side! However, I did find a strange bug in from espn_api.baseball import League
league = League(league_id=1234, year=2024, espn_s2='<redacted>', swid='<redacted>')
# Gather free agent pitchers
free_agents = league.free_agents(position_id=14, size=1)
print("\nFree Agents")
for free_agent in free_agents:
print(f"Name: {free_agent.name}, Eligible Positions: {free_agent.eligibleSlots}, Position: {free_agent.position}, Team: {free_agent.proTeam}, PlayerId {free_agent.playerId}")
print(f"Name: {free_agent.name}, Eligible Positions: {free_agent.eligibleSlots}, Position: {free_agent.eligibleSlots[0]}, Team: {free_agent.proTeam}, PlayerId {free_agent.playerId}") Output:
As you can see, I was able to work around this using Side note: Any chance we will get the docs soon? I'd love to dive a little deeper. |
I just looked into it and it seems like for pitchers ESPN sets their default position id to |
No description provided.
The text was updated successfully, but these errors were encountered: