Welcome to the Fantasy Football Repository! This repository contains code for managing fantasy football matchups and generating formatted scores for analysis. Below, you will find information on how to use the code, dependencies, and other relevant details.
Before you get started, make sure you have the following installed on your system:
- Python 3.11
- Pip (Python package manager)
To set up the fantasy football project, follow these steps:
-
Clone the repository to your local machine:
git clone <repository-url> cd fantasy-football-repo
-
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.envfile in the project root directory and add your OpenAI API key and sleeper league id in the following format:OPENAI_API_KEY=your-api-key-goes-here LEAGUE_ID=your-league-id-goes-here
To use the fantasy football code, run the following command in the terminal or command prompt:
python main.py -w <week-number>Replace <week-number> with the desired week for which you want to generate fantasy football scores and matchups.
This codebase fetches fantasy football matchups for a specific week using the Sleeper API. It calculates scores and formats the data into a tabular format, which can be easily copied into Excel or other spreadsheet tools for further analysis.
The main components of the code are as follows:
-
main.py: This script contains the main functionality. It retrieves matchups for the specified week, calculates scores, and formats the data. -
sleeper_wrapper: This is a Python wrapper for the Sleeper API, used to fetch fantasy football league data. -
openai: This module integrates OpenAI's GPT-3.5 Turbo model to format the data into a user-friendly format. -
.env: This configuration file stores the OpenAI API key. Make sure to keep it secure and never share it publicly.
This project is licensed under the MIT License, which means you are free to use, modify, and distribute the code as you like. See the LICENSE file for more details.