[GH-ISSUE #681] [General] Option to disable having to use the default leagues #139

Open
opened 2026-03-02 15:56:08 +03:00 by kerem · 4 comments
Owner

Originally created by @lorenzodb1 on GitHub (Aug 19, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/681

LEAGUE_DICT provides a list of default leagues that will be used, along with the ones defined in league_dict.json.

LEAGUE_DICT = {**LEAGUE_DICT, **json.load(json_file)}

This can be a bit annoying, as I'd have to remove each of the leagues that I don't need individually, thus making my code dirty.

Would it be possible to add an option (maybe as an environment variable, but that's just an idea) to disable this behaviour and only use the leagues in league_dict.json instead?

Originally created by @lorenzodb1 on GitHub (Aug 19, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/681 `LEAGUE_DICT` provides a list of default leagues that will be used, along with the ones defined in `league_dict.json`. ``` LEAGUE_DICT = {**LEAGUE_DICT, **json.load(json_file)} ``` This can be a bit annoying, as I'd have to remove each of the leagues that I don't need individually, thus making my code _dirty_. Would it be possible to add an option (maybe as an environment variable, but that's just an idea) to disable this behaviour and only use the leagues in `league_dict.json` instead?
Author
Owner

@probberechts commented on GitHub (Aug 20, 2024):

That's a good suggestion. I think I would implement this by creating a default league_dict.json file if it does not exist yet and move the league config that is now in _config.py to that default league_dict.json file.

I don't have plan to implement this myself in the short term, but feel free to create a pull request.

<!-- gh-comment-id:2298506336 --> @probberechts commented on GitHub (Aug 20, 2024): That's a good suggestion. I think I would implement this by creating a default `league_dict.json` file if it does not exist yet and move the league config that is now in `_config.py` to that default `league_dict.json` file. I don't have plan to implement this myself in the short term, but feel free to create a pull request.
Author
Owner

@lorenzodb1 commented on GitHub (Aug 20, 2024):

How about letting whatever is specified in league_dict.json, if present, override the default list of leagues?

<!-- gh-comment-id:2299400417 --> @lorenzodb1 commented on GitHub (Aug 20, 2024): How about letting whatever is specified in `league_dict.json`, if present, override the default list of leagues?
Author
Owner

@probberechts commented on GitHub (Aug 22, 2024):

I don't think that would provide the best user experience. Most users want to add additional leagues, not remove the default ones.

<!-- gh-comment-id:2304103869 --> @probberechts commented on GitHub (Aug 22, 2024): I don't think that would provide the best user experience. Most users want to **add** additional leagues, not remove the default ones.
Author
Owner

@lorenzodb1 commented on GitHub (Sep 10, 2024):

Ok so I'm starting to think about how I could implement this. If we were to with the solution you suggested, we'd have to create the default league file at make, as the position of that file isn't fixed. I'm not sure how this can be achieved in a clean way.

What do you think about using an environment variable to let the user decide whether they want to include the default set of leagues or not?

<!-- gh-comment-id:2342315852 --> @lorenzodb1 commented on GitHub (Sep 10, 2024): Ok so I'm starting to think about how I could implement this. If we were to with the solution you suggested, we'd have to create the default league file at `make`, as the position of that file isn't fixed. I'm not sure how this can be achieved in a clean way. What do you think about using an environment variable to let the user decide whether they want to include the default set of leagues or not?
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#139
No description provided.