roclark / sportsipy

A free sports API written for python
MIT License
476 stars 189 forks source link

Extended Major League Soccer Version of this API #335

Closed josephtrocchio closed 4 years ago

josephtrocchio commented 4 years ago

Hello!

I love the work that has been done here. As a sport performance coach/ hobbyist programmer in professional soccer, I'd love to somehow incorporate this API into to some everyday scripts/ data analytics projects!!

I noticed there was a "Soccer" section on the sports-reference website with similar functionality as the rest of the sports. Are there any plans to extend the current package/ API to Major League Soccer?? If so, I'd love to help out in any way possible, even if it's small.

roclark commented 4 years ago

Hey @llrantzll, thanks for the request! That's awesome that you work as a performance coach! And even better to marry that with programming! šŸ˜ƒ

I've been eagerly following the development of FBref on sports-reference.com and wanting to support it in this package, but both didn't have time and also wanted to wait for the site to mature a bit. I've spent some time over the past week on the interface and actually feel I have a decent start at support not only MLS but all football/soccer and created PR #356 to include it with my next release. With the update, you can do the following (I'm an SKC fan, but I will use the Union for your sake):

from sportsreference.fb.team import Team

union = Team('Philadelphia Union')
print(union.manager)  # Prints 'Jim Curtin'
print(union.country)  # Prints 'United States'
print(union.points)  # Prints 1
print(union.league)  # Prints 'Major League Soccer'

for game in union.schedule:
    print(game.opponent)  # Prints the name of every opponent in the schedule

for player in union.roster:
    # Prints each player's name, minutes played this season, and expected goals
    print(player.name, player.minutes, player.expected_goals)

This is by no means a complete example, but should provide a decent overview of how the new modules work. Once the changes are merged, the docs should be updated with the complete API specification of all new properties.

Hope this helps! I will continue to expand this moving forward, but feel good about the current implementation as a starter.

josephtrocchio commented 4 years ago

Hello!,

Thank your for the response! Anything helps so any info on the topic is great. Im currently developing an Athlete Management System through Python, Django, Postgres, and Docker that can hold/ distribute the organizations data (wellness, testing, etc.) it would be nice to use packages like yours to do some cool analysis.

Iā€™d like to stay in touch and will continue to follow the progress!

All the best,

Joseph E Trocchio jr.

On Mar 26, 2020, at 11:30 AM, Robert Clark notifications@github.com wrote:

ļ»æ Hey @llrantzll, thanks for the request! That's awesome that you work as a performance coach! And even better to marry that with programming! šŸ˜ƒ

I've been eagerly following the development of FBref on sports-reference.com and wanting to support it in this package, but both didn't have time and also wanted to wait for the site to mature a bit. I've spent some time over the past week on the interface and actually feel I have a decent start at support not only MLS but all football/soccer and created PR #356 to include it with my next release. With the update, you can do the following (I'm an SKC fan, but I will use the Union for your sake):

from sportsreference.fb.team import Team

union = Team('Philadelphia Union') print(union.manager) # Prints 'Jim Curtin' print(union.country) # Prints 'United States' print(union.points) # Prints 1 print(union.league) # Prints 'Major League Soccer'

for game in union.schedule: print(game.opponent) # Prints the name of every opponent in the schedule

for player in union.roster:

Prints each player's name, minutes played this season, and expected goals

print(player.name, player.minutes, player.expected_goals)

This is by no means a complete example, but should provide a decent overview of how the new modules work. Once the changes are merged, the docs should be updated with the complete API specification of all new properties.

Hope this helps! I will continue to expand this moving forward, but feel good about the current implementation as a starter.

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

roclark commented 4 years ago

Of course, I apologize for the lengthy delay as I am currently changing jobs, but appreciate the feedback! And your application sounds awesome! I would love to do my little part to help make that a reality. Feel free to open more issues for future features you would like to add or ways to make your development easier.

FYI, when I merge the PR, this issue will automatically close, but we can certainly continue discussing here if needed or use other issues as mentioned.

Thanks again!