This script retrieves NBA stats and data from the NBA API and displays them in the terminal.
- Python 3.x
requests
module (pip install requests
)
- Clone the repository
- Navigate to the project directory
- Run the script using
python main.py
- The console will display team stats sorted by points per game.
get_links()
function retrieves links to data from the NBA APIget_scoreboard()
function retrieves current scores and game information and prints them to the consoleget_stats()
function retrieves team stats and prints them to the console, sorted by points per game- The script uses the
requests
module to make HTTP requests to the NBA API and thepprint
module to format the output.
The NBA API is subject to change, which may cause this script to fail or produce unexpected output.