I actually just implemented some thing very similar to this. You probably want to checkout Dashing [1] which has built in plugins for a lot of things already. It's pretty easy to work with as well.
> I've been looking for something to do this (below) in python at least on backend.