Skip to content
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

[Match History] Different League URL for custom leagues #589

Open
TK5-Tim opened this issue May 22, 2024 · 2 comments
Open

[Match History] Different League URL for custom leagues #589

TK5-Tim opened this issue May 22, 2024 · 2 comments
Labels
enhancement New feature or request MatchHistory Issue or pull request related to the MatchHistory scraper

Comments

@TK5-Tim
Copy link

TK5-Tim commented May 22, 2024

After adding the Swiss first league to the package as a custom league dictionary. I tried to pull the Match history.
I noticed an issue with the seasons argument in the MatchHistory instance.
For smaller league like the Swiss league the whole match history is put into one file. That also means that the URL is different.
Instead of the expected URL
https://www.football-data.co.uk/mmz4281/2324/SWZ.csv

The actual URL is:
https://www.football-data.co.uk/new/SWZ.csv

would it make sense to have the possibility to get the different URL or is the data too different anyway?

@probberechts probberechts added enhancement New feature or request MatchHistory Issue or pull request related to the MatchHistory scraper labels May 27, 2024
@probberechts
Copy link
Owner

I had a quick look and the smaller leagues seem to contain a subset of the data (with different column headers) of the bigger leagues. This means that it should be possible to merge them. Basically, you would have to update the MatchHistory.read_games method to check whether the requested league is a smaller league and if so

  • not loop over the seasons
  • use a different URL
  • rename the column headers such that they map on the column headers used in the bigger leagues

I do not have plans to implement this myself, but if anyone would be interested in taking a stab at it, I would be happy to review it.

@TK5-Tim
Copy link
Author

TK5-Tim commented May 29, 2024

Thanks a lot for the breakdown. I'm hoping to find the time to take a stab at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MatchHistory Issue or pull request related to the MatchHistory scraper
Projects
None yet
Development

No branches or pull requests

2 participants