Charting Energy Use with Flask

I have developed a version of the Energy Monitor from this post that instead uses Python to display the data on an internal network.

The code can be found here: https://github.com/benhoyle/FlaskEnergyMeter.

I use Flask to render a basic template to obtain search parameters:

HTML Form for Data Selection

HTML Form for Data Selection

The code on the back-end then connects to my SQLite3 database and extracts the data according to the entered ranges. [This is slow so I may look into caching the database data.]

I then use pandas for some time-series manipulation. For example, resampling by hour, day, week, month or year is simple with pandas.

Finally I use pygal to render the manipulated data as an SVG:

2014-01-03 16.35.12

A pygal Time Series Chart

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s