ActivityWatch / activitywatch

The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.
https://activitywatch.net/
Mozilla Public License 2.0
12.66k stars 565 forks source link

Implement reporting #233

Open ErikBjare opened 6 years ago

ErikBjare commented 6 years ago

Reporting is the requested "enterprise feature" that we could provide. Since this is basically only used in a company/consultancy or enterprise environment perhaps there is a way to earn some money by developing it exclusively for paying customers?

TODO

Problem

ActivityWatch already has usage within companies and is then usually set up as a single server to which many clients report (see for example this 60 client setup). This has vast privacy issues and is not an acceptable solution in the vast majority of cases as it has a high risk of being misused for involuntary, covert, or straight illegal employee surveillance.

How it could work

Users could whitelist which activities (or categories of activities) to report, only letting the employee what work-related things were done. This would be a great start.

You can vote on this feature on the forum!

jantman commented 5 years ago

For what it's worth, I'm an individual user and would be interested in basic reporting functionality. I'm not sure what the Enterprise use case is, but all I'm really interested in (and might hack up something for myself) is the same high-level "Top-10" type information that's displayed on the Activity page of the UI, but emailed to me daily (i.e. a "Last 24 hours" summary).

ErikBjare commented 5 years ago

@jantman I think that would be very different from the type of reporting I had in mind when I created this issue.

jantman commented 5 years ago

Ahhhhh that makes a lot more sense. Sorry for my misunderstanding of the goal.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ErikBjare commented 3 years ago

Today I wrote a script in https://github.com/ActivityWatch/aw-client/pull/52 for calculating working hours from ActivityWatch data, it seems to work pretty well.

I also wrote this forum post a while back about "Getting paid with ActivityWatch": https://forum.activitywatch.net/t/getting-paid-with-activitywatch/986/5

ErikBjare commented 3 years ago

I know this is the wrong issue, but what @jantman described might actually be useful for most users (not just the team/enterprise target of the reporting in this issue). I've heard from quite a few users that they find the emails from RescueTime etc. useful.

It could also be implemented fairly soon (would probably only take a weekend to hook up stats from aw-client-python to an email server), if someone has time.

The only catch is that users would need to supply email server credentials.

ErikBjare commented 9 months ago

I want to mention that I currently have a reporting system set up, where it reports to a Google Sheet.

The basic code for it is in the aw-client examples: https://github.com/ActivityWatch/aw-client/blob/master/examples/working_hours_gspread.py

I've then created a small wrapper script, which I run as a cronjob:

aw-work-gspread-sync.sh:

#!/bin/bash
set -e

regex="YOUR_WORK_REGEX_HERE"
sheet_id="YOUR_GSHEET_ID_HERE"

echo "Syncing activitywatch data to Google Sheets..."

# activate virtualenv
. $HOME/.virtualenvs/activitywatch/bin/activate

# cd to examples dir
cd $HOME/Programming/activitywatch/aw-client/examples

# path to poetry (needed for cron)
poetry="$HOME/.local/bin/poetry"

# run script
$poetry run python3 working_hours_gspread.py "$sheet_id" "$regex"

This works very well for me.

If anyone is interested in more details/how to set it up, let me know!