[GH-ISSUE #589] [Match History] Different League URL for custom leagues #106

Open
opened 2026-03-02 15:55:51 +03:00 by kerem · 2 comments
Owner

Originally created by @TK5-Tim on GitHub (May 22, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/589

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?

Originally created by @TK5-Tim on GitHub (May 22, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/589 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?
Author
Owner

@probberechts commented on GitHub (May 27, 2024):

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.

<!-- gh-comment-id:2133726588 --> @probberechts commented on GitHub (May 27, 2024): 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.
Author
Owner

@TK5-Tim commented on GitHub (May 29, 2024):

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

<!-- gh-comment-id:2136727005 --> @TK5-Tim commented on GitHub (May 29, 2024): Thanks a lot for the breakdown. I'm hoping to find the time to take a stab at this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#106
No description provided.