From fc0ea096722178bd609bce168d194c926d411a38 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 5 Apr 2025 13:50:08 -0500 Subject: 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> --- nba/fetch_data.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'nba/fetch_data.py') 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 -- cgit v1.2.3-70-g09d2