- Python 3.11 (or higher)
- PostgreSQL 15 (or higher)
- pgAdmin 4 (Not strictly necessary but its what I used to manage the database)
- app.py : The Streamlit web application and UI logic
- database.py : SQLAlchemy DatabaseConnector class and engine
- models.py : ORM classes defining the database schema
- nfl_data_import.py : Script to fetch and load NFL roster data in database
- stat_import.py : Script to fetch and load weekly box scores in database
- database_schema.sql: pg_dump file containing the database schema only
- data.sql : pg_dump file containing the database data only
- requirements.txt : List of required Python libraries
- .env : Database connection credentials
- Open pgAdmin 4 (or your preferred method of acessing postgres)
- Create a new, empty database named: fantasy_football
The included .env file contains the credential variables for the application to interact with the database. It currently has my local environment credentials but update the user and pass fields to match your local setup.
DB_HOST=localhost DB_NAME=fantasy_football DB_USER=postgres // change to your local postgres username DB_PASS=admin // change to your local postgres password
Dependencies for the project can be installed with pip through requirements.txt:
pip install -r requirements.txt
-
Build the database tables via SQLAlchemy: python database.py
-
Download and insert the NFL team and player rosters into the database: python nfl_data_import.py
-
Download, clean, and insert the historical weekly statistics: python stat_import.py
Application can be run and acessed in your browser through the streamlit run command in terminal:
streamlit run app.py