Python Dynamic Power Price Information using Streamlit & Deployed to Windows Server

preview_player
Показать описание
This video is a follow on from:
Where I wanted to show dynamic chart of electricity prices on a webpage and be able to update the data as required.
I initially wanted to use Plotly dash but chose Streamlit instead as I’d recently completed a simple share price tutorial and found it easy to use. Streamlit allows you to use different visualisation libraries and I tried MatPloLib, Altair, Plotly & Bokeh. In the end I will use the Plotly chart as it meets my needs, especially when using mobile devices.
I had a real issue trying to deploy it to a Windows Server. In the end I couldn’t get the IIS to work as a subdomain for the app so chose to run it on a Task Scheduler trigger and create a Firewall inbound Rule to allow a specific port to be opened so that a HTTP:// to my IP with a specific port could be accessed from remote PC’s and web browsers. This was not the most satisfying solution but as the app is for me personally, its an acceptable solution at this time.
As I have a VPS Windows server this is not my preferred option, as I want to maintain all my projects on my server, but this is an easy way to have your app running in the cloud.
I a very pleased with Streamlit setup and the webpage for the data, it gives me a more personal setup for accessing my data, with a table based on selected pricing criteria as well.
There was a bit of an adjustment to ensure the app worked well on Mobile device and I may have to do some other tweeks to make it look better on a mobile device.
NOTE- The API call will not work as the API keys are held in a .env file.
If you want to run the BOKEH library with stremleit at this time you need to do : pip install bokeh==2.4.3 as it doesn’t run with the latest Bokeh v 3 library.
Kind regards, Max Drake
Рекомендации по теме