30
loading...
This website collects cookies to deliver better user experience
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
sid
inside a list which holds all these sid
s of the connected clients. Once a client disconnects (which is generally by closing the browser tab), I remove the sid
of that particular client from the list. ping_graph
. The event handler ping_graph
(line 22-34) is responsible for pinging the client continuously with the data it requested for (in this case symbol of the company for which it wants the plot for)yfinance
with 1 minute interval. Next I plot a mountain graph using the data. I've set the line color to change depending on whether the prices increase, decrease, or stay the same. I also added some buttons which will allow quick switching between ranges.gunicorn
and eventlet
to run the Socket.IO sereverexport PYTHONPATH=src
gunicorn -k eventlet -w 1 --reload src.main:app
/
src/
├─ main.py
├─ scripts/
│ ├─ plot.py
requirements.txt