Client library for ActivityWatch
Project description
aw-client
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 thepoetry.lock
file).
- If you don't want to use poetry you can also use
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" }
inpyproject.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.
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
aw_client-0.5.14.tar.gz
(20.5 kB
view details)
Built Distribution
File details
Details for the file aw_client-0.5.14.tar.gz
.
File metadata
- Download URL: aw_client-0.5.14.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.6.49-1-lts
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94cf9614029ee416c44590126f2975512d7b37869bf8b8de62c5e03d68996859 |
|
MD5 | cb834534e1108e851887fed6c5da27aa |
|
BLAKE2b-256 | 93b6b18fb100f8adeff7f2bfd2d5f5a9aec41526a9df6df4abb2ba46e6c79441 |
File details
Details for the file aw_client-0.5.14-py3-none-any.whl
.
File metadata
- Download URL: aw_client-0.5.14-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.6.49-1-lts
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18a72a4c6a662f01028f97aa50bd1eb8d00d7b531a544e9c25fc1bc86380bfa9 |
|
MD5 | 7f66297bd1d9b3a08988271448faf560 |
|
BLAKE2b-256 | aeb66e3fa27fec10fe511fc7d369e6f008b8810e3feded4989131cc91f4434fb |