All Projects → ActivityWatch → aw-client

ActivityWatch / aw-client

Licence: MPL-2.0 license
Client library for ActivityWatch

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to aw-client

aw-watcher-spotify
Logs what you listen to on Spotify
Stars: ✭ 41 (+51.85%)
Mutual labels:  activitywatch
thesis
MSc thesis on: Classifying brain activity using EEG and automated time tracking of computer use (using ActivityWatch)
Stars: ✭ 44 (+62.96%)
Mutual labels:  activitywatch
Activitywatch
The goal of ActivityWatch is simple: Enable the collection of as much valuable lifedata as possible without compromising user privacy.
Stars: ✭ 5,927 (+21851.85%)
Mutual labels:  activitywatch
aw-watcher-jetbrains
This extension allows the open source tracking tool ActivityWatch to keep track of the projects and coding languages you use in jetbrains IDEs.
Stars: ✭ 36 (+33.33%)
Mutual labels:  activitywatch
aw-android
ActivityWatch for Android, using aw-server-rust as backend.
Stars: ✭ 87 (+222.22%)
Mutual labels:  activitywatch
aw-watcher-window
Cross-platform window watcher (for use with ActivityWatch)
Stars: ✭ 43 (+59.26%)
Mutual labels:  activitywatch
aw-webui
Webapp for visualizing and browsing ActivityWatch data, built with Vue.js.
Stars: ✭ 68 (+151.85%)
Mutual labels:  activitywatch
aw-server-rust
High-performance implementation of the ActivityWatch server, written in Rust
Stars: ✭ 76 (+181.48%)
Mutual labels:  activitywatch

aw-client

GitHub Actions badge PyPI Code style: black Typechecking: Mypy

Client library for ActivityWatch in Python.

Please see the documentation for usage, and take a look at examples/.

How to install

Install from pip: pip install aw-client

Install the latest version directly from github without cloning: pip install git+https://github.com/ActivityWatch/aw-client.git

To install from a cloned version:

  • clone repo: git clone https://github.com/ActivityWatch/aw-client.git
  • cd into the directory: cd aw-client
  • run poetry install (will create a virtualenv, if none activated)
    • If you don't want to use poetry you can also use pip install ., but that might not get the exact version of the dependencies (due to not reading the poetry.lock file).

Usage

For the CLI:

$ aw-client --help
Usage: aw-client [OPTIONS] COMMAND [ARGS]...

  CLI utility for aw-client to aid in interacting with the ActivityWatch
  server

Options:
  --host TEXT     Address of host
  --port INTEGER  Port to use
  -v, --verbose   Verbosity
  --testing       Set to use testing ports by default
  --help          Show this message and exit.

Commands:
  buckets    List all buckets
  canonical  Query 'canonical events' for a single host (filtered,...
  events     Query events from bucket with ID `bucket_id`
  heartbeat  Send a heartbeat to bucket with ID `bucket_id` with JSON `data`
  query      Run a query in file at `path` on the server
  report     Generate an activity report

Debugging

  • Run python with LOG_LEVEL=debug to get additional debugging output
  • If invalid events have been queued for submission, you may need to delete the file-based queues generated by this library
  • To use the development version of this library use aw-client = {path = "../aw-client" } in pyproject.toml

Examples

The examples/ directory contains a couple of example scripts, including:

  • time_spent_today.py - fetches all non-afk events and sums their duration to get the total active time for the day.
  • working_hours.py - computes hours worked per day (matching a "work" category rule), and exports matching events to a JSON file (for auditing).
  • load_dataframe.py - loads events from a host using a categorizing & AFK-filtering query, put result in a pandas dataframe, and export as CSV.
  • merge_buckets.py - merges two buckets with non-intersecting events by moving all events from one into the other.
  • redact_sensitive.py - redact sensitive events.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].