probberechts / soccerdata

⛏⚽ Scrape soccer data from Club Elo, ESPN, FBref, FiveThirtyEight, Football-Data.co.uk, FotMob, Sofascore, SoFIFA, Understat and WhoScored.
https://soccerdata.readthedocs.io/en/latest/
Other
511 stars 87 forks source link

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

Open TK5-Tim opened 1 month ago

TK5-Tim commented 1 month ago

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 commented 1 month ago

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

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 commented 1 month ago

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