diff options
author | Christian Cleberg <hello@cleberg.net> | 2025-04-05 13:50:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-05 13:50:08 -0500 |
commit | fc0ea096722178bd609bce168d194c926d411a38 (patch) | |
tree | 1a587e9dcc7c2718731c20e4b667c7c9ca913369 /nba/fetch_data.py | |
parent | 4d82554601ad5aba75accd4917bbad1969892203 (diff) | |
download | nba-scores-fc0ea096722178bd609bce168d194c926d411a38.tar.gz nba-scores-fc0ea096722178bd609bce168d194c926d411a38.tar.bz2 nba-scores-fc0ea096722178bd609bce168d194c926d411a38.zip |
migrate from pylint to ruff (#3)
* migrate from pylint to ruff
* Commit from GitHub Actions (Ruff)
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'nba/fetch_data.py')
-rw-r--r-- | nba/fetch_data.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/nba/fetch_data.py b/nba/fetch_data.py index 71cac33..49503cc 100644 --- a/nba/fetch_data.py +++ b/nba/fetch_data.py @@ -1,28 +1,30 @@ """ Fetches data for use in other modules. """ + import json from nba_api.live.nba.endpoints import scoreboard from nba_api.stats.endpoints import leaguestandings + def fetch_data() -> tuple: - """ - Fetches live NBA scoreboard data and standings from the NBA API. + """ + Fetches live NBA scoreboard data and standings from the NBA API. - Returns: - games (dict): JSON parsed games data. - standings (dict): JSON parsed team standings data. - """ - # Get today's scoreboard data - games_endpoint = scoreboard.ScoreBoard() - games_json = games_endpoint.get_json() + Returns: + games (dict): JSON parsed games data. + standings (dict): JSON parsed team standings data. + """ + # Get today's scoreboard data + games_endpoint = scoreboard.ScoreBoard() + games_json = games_endpoint.get_json() - # Get league standings - standings_endpoint = leaguestandings.LeagueStandings() - standings_json = standings_endpoint.get_json() + # Get league standings + standings_endpoint = leaguestandings.LeagueStandings() + standings_json = standings_endpoint.get_json() - # Parse the JSON strings into Python dictionaries - games = json.loads(games_json) - standings = json.loads(standings_json) + # Parse the JSON strings into Python dictionaries + games = json.loads(games_json) + standings = json.loads(standings_json) - return games, standings + return games, standings |