• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Python Web GUI

Protagoras

Contractor Among Contractors
Thanks received
150
It's winter project time. I'd like to display my electricity and gas use on a Web page rather than have to access the Octopus App.

Thinking about a tech stack for this ...
Python - seems to be a reasonable choice
Data storage - should I store data in arrays, or write it to a SQL DB?
GUI - which Python GUI framework to display values and graphs and allow controls to switch between these.

Expanding on this, I'd really like to display this on a low power display like TRMNL, but this that this is probably a Phase 2. It would be handy to have a display on the wall - this could also show real-time electricity use.

Any thoughts / recommendations?
 
I’d probably go with Postgres to store the data.
If you’re planning on pulling the data from the Octopus app, I would suggest just pulling the consumption, not the “cost” if you’re on a variable tariff, as sometimes the app displays the cost incorrectly live, but has it correct on the bill.
It’s one of the chief talking points on IOG groups on Facebook.

MyEnergi have a simple display that shows usage/generation, but I think it requires having their hardware and it’s just live, so no historical view.
 
I'd pull the data from Octopus with the appropriate API.

I'm currently on a long-term fixed tariff, with an exit penalty! If we had regional pricing, I'd get a much better rate since live north of the B6 transmission boundary and on any windy day, there's a surplus of available energy here. Frankly, there was no attractive tariff available. At least cost is easy to calculate!
 
do contractors worry about energy bills??
who knew?
INKSPE.

Worry, no. Get annoyed, yes, and very.

I resent paying, but at least I can. Millions can't even afford to keep warm.

It's outrageous that we have such high energy costs which arise owing to policy decisions - or the lack of them. How did we ever get to deserve the terrible governments of the last three or so decades ...

I still don't know which GUI framework to go with - too much choice!
 
If it’s just some local data and you aren’t expecting a flood of traffic, SQLite would be perfectly fine. It’s a proper relational database, but everything’s stored in one file on the local disk. No hassle with installation, drivers, and all that malarkey. Back it up by copying the file.

I’d suggest using Django, as it does everything you could possibly need. The default project configuration even creates a SQLite database for you, and takes care of all the object-relational mapping. Loads of libraries available for things like graphs and such, and the web is awash with documentation and tutorials :)
 

Advertisers

Back
Top