Skip to content

ActivityWatch Experiments

TODO Logs Merge ActivityWatch Exports

Summary

Project source code available at dentropy/aw-experiments

Summary

ActivityWatch meets jupyter-notebooks

The purpose of this repo is to showcase the various ways I queried my ActivityWatch.

My goal is to generate a graph of the websites I go to the most similar to the 'Top Browser Domains' feature but like another person I can not get it working.. I look forward to whenever 0.12.0 get's released. To view the production jupyter notebook click here

Queries:

  • Domain Name Queries
  • Extract all domain names and sort by most visited
  • Find number of unique domain names
  • Find total number of websites visited
  • Time Based Queries
  • Number of events per hour visualized as a heatmap
  • Average number of events on weekdays verses weekend

Explanation of files

The production notebook has the results of everything in the practice folder. To view it click here and here is a link to the actual notebook

Story of what is in the practice folder

First I coppiced the sqlite database from https://docs.activitywatch.net/en/latest/directories.html and played with it within QueryCrafting.ipynb and GraphingUp.ipynb. Inside QueryCrafting.ipynb I wrote and troubleshooted a query get all the domain names and group them distinctly. I then used the query from QueryCrafting.ipynb inside GraphingUp.ipynb to generate a graph using plotly.

While troubleshooting 'Top Browser Domains' feature I realized ActivityWatch has an API I can just strait up query rather than pulling from the sqlite file. So that's what I did in UsingAW-API.ipynb Turns out you can load the events strait into a pandas dataframe and play with it from there which I thought was pretty awesome.

Requirements

  • Python
  • pip packages used
  • pandas
  • jupyterlab
  • plotly
  • ipython-sql
  • Activity watch sqlite database

Setup

git clone https://github.com/dentropy/aw-experiments.git
cd aw-experiments
python3 -m venv env
source env/bin/activate
pip install -r ./requirements.txt
jupyter lab .

Next Steps

  • Aggregate duration for websites browsed
  • Find most visited URLs
  • Narrow by specific website
  • Learn Querying Data