Manager (and hopefully UI) for Mike's shitty march madness bracket.
I recommend you manage python via miniconda (how to install).
conda create -y -n madness python=3.8
conda activate madness
pip install -r requirements.txt
Add your odds-api key and path to csv with team data to the .env
file in this directory (there's already one committed in this repo and set in th .env
by default).
The server is setup using Fast API, and will run on your localhost via:
uvicorn run_server:app
Navigate to http://127.0.0.1:8000/api/print-bracket to view the current bracket! It currently makes an API call to ESPN every minute, and only calls odds API for each game once upon scheduling, and again as soon as the game begins to try to get the opening spread.
/api/print-bracket
:
- prints the bracket as HTML
/api/bracket-as-json
:
- returns the bracket as nested json, with the fields defined here. Importantly,
"bracket"
is the root node (orEvent
) of the tree, with the fields defined here. This json is huge, open up chrome with "pretty-print" on your local host here: http://127.0.0.1:8000/api/bracket-as-json (also currently available on an ec2 machine here: http://ec2-18-208-184-64.compute-1.amazonaws.com/api/bracket-as-json, but prob not for long).
ESPN API for scores. Looking at odds-api for lines.
- Add UI, ideally from here, but I don't know javascript 🤡. I assume we just need this app to return the bracket in json form compatible with the dude's model.
- Clean up and test updating logic
- Add script to run on ☁️
- Referenced this blog to get it running on ec2.
- Note: the
location /api
in your nginx config must match the endpoints specified in python via FastAPI
- 1 million other things in my life
- Add UI for bracket creation so that user doesn't need to provide a CSV file