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

[General] Option to disable having to use the default leagues #681

Open
lorenzodb1 opened this issue Aug 19, 2024 · 4 comments
Open

[General] Option to disable having to use the default leagues #681

lorenzodb1 opened this issue Aug 19, 2024 · 4 comments
Labels
common Issue or pull request related to all scrapers enhancement New feature or request

Comments

@lorenzodb1
Copy link
Contributor

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?

@probberechts probberechts added enhancement New feature or request common Issue or pull request related to all scrapers labels Aug 20, 2024
@probberechts
Copy link
Owner

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.

@lorenzodb1
Copy link
Contributor Author

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

@probberechts
Copy link
Owner

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

@lorenzodb1
Copy link
Contributor Author

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Issue or pull request related to all scrapers enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants