Heartbeat data plotter for matplotlib
Project description
This is just a tool for taking activity "heartbeats" (where something outputs what it is currently doing periodically) and making a few interesting charts and graphs with it using matplotlib.
This was originally written specifically for Wakatime data, but there's no reason it couldn't be applied to other things. For example, I am planning on using this with Discord rich presense activity exports.
Example usage (Wakapi):
from sqlite3 import connect
from datetime import datetime
from HeartbeatsData.heartbeats_data import HeartbeatData, show
print("Reading data")
conn = connect("../wakapi_db.db")
cur = conn.cursor()
hbs = cur.execute("SELECT project,time FROM heartbeats WHERE user_id='hopperelec'").fetchall()
print("Parsing data")
hb_data = HeartbeatData()
for hb in hbs:
hb_data.add_hb(hb[0], datetime.strptime(hb[1][:19] + hb[1][-6:], "%Y-%m-%d %H:%M:%S%z"))
print("Producing legend")
hb_data.legend(ncol=2)
print("Plotting data")
# hb_data.plot_scatter()
hb_data.plot_durations(slider_kwargs={"default": 900})
# hb_data.plot_duration_counts(False, True, slider_kwargs={"default": 5400})
print("Displaying plot")
show()
Samples
(using the above code, all with the same data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
HeartbeatsData-1.0.0.tar.gz
(17.4 kB
view hashes)
Built Distribution
Close
Hashes for HeartbeatsData-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98460d6a49d4600f5e61fd7b276eb07bb354a9056467fc3217489994c19190b6 |
|
MD5 | 2393a0df56c5be4352373989c61c9029 |
|
BLAKE2b-256 | c55d396cd7357efe9b4326ae23dbcfae6e765422bdc331d2c78308406c275a72 |