A Streamlit application to view NBA games and news, showcasing modularity in Python code organization.
- View NBA games by date with team logos.
- Fetch and display the latest NBA news.
- Modular Python codebase for better organization and maintenance.
First, clone the repository:
git clone https://github.com/OrenGrinker/NBAStreamlit
cd NBAStreamlit
Then, install the required dependencies:
pip install -r requirements.txt
To fetch NBA data, you need an API key from Sportsdata.io:
- Visit Sportsdata.io.
- Register for an account and log in.
- Navigate to the API keys section and generate a new API key for the NBA API.
- app.py: The main Streamlit application file.
- nba_utils.py: Contains utility functions for fetching and displaying NBA games and news.
- team_logos.py: Holds the dictionary mapping team abbreviations to their logo URLs. Usage
Run the Streamlit application:
streamlit run app.py
Enter your API key in the sidebar within the app to start fetching NBA games and news data.