roclark / sportsipy

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

Script running but no data returned #778

Open haubnee opened 1 year ago

haubnee commented 1 year ago

I'm attempting to run some sample scripts as outlined in the examples. I'm not getting any errors but there is no data returning at all.

from sportsipy.mlb.teams import Teams teams = Teams() for team in teams: print(team.name, team.abbreviation)

I expect team names and abbreviations to print but they are not.

image

Desktop (please complete the following information):

Please help!

ianstack commented 1 year ago

I have the same issues :(

macgormain commented 1 year ago

Same issue here. I went to the sportsreference site and it seems to have created other websites that hold the actual information. This project may have just been torpedo'd because of it.

davidjkrause commented 1 year ago

Ran into this error and found after some investigating I had updated my packages to include pyquery=2.0.0, instead of 1.4.0. This new version of pyquery requires explicit identifcation of URLs. (Note: In my personal project I needed the later pyquery for other code I was also running along with sportsipy.)

This commit worked for me to get schedules for various leagues, and I updated the rest of the code where it appeared URL identification was needed as well.

I could probably turn this into a pull request, but I'm not sure this project is being actively updated now.

https://github.com/roclark/sportsipy/commit/bcd92b58ed0d2ce9c6918015e64db62af8fb9627

The specific branch this commit is on is:

https://github.com/davidjkrause/sportsipy/tree/pyquery2

Interested to hear if this helps anyone get by the issues mentioned above.

Duck-m-a-n commented 1 year ago

Your fix did the job I can't thank you enough! Just had to include url=

swisi commented 1 year ago

Will the solution of @davidjkrause be implemented?

davidjkrause commented 1 year ago

My patch for pyquery2 breaks many existing tests. Note that many of the current tests already don't pass, but the pyquery change breaks more.

I'm working on fixing all the test cases, and will update my branch. Some need fixing for the pyquery change, others are broken in base, and others don't fail but will if the locally stored HTML is updated because the source site has change format.

This is all a pretty big effort, but I'm making solid progress on this and plan to get my fork of this repo at least mostly working in the next few days. I've made many changes to fix issues, but the best approach would be to break the work into separate related patches, rather than just a bulk update.

davidjkrause commented 1 year ago

https://github.com/davidjkrause/sportsipy/tree/pyquery2 is updated with all tests fixed, and a number of other fixes for recent data format changes.

Planning to continue working on my branch / fork to bring in other PRs which fix data issues and have been sitting for a while.