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.lockfile).
- 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=debugto 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.
Metadata
Release files for aw-client 0.5.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aw_client-0.5.15.tar.gz | 20.5 kB | Without provenance | Details for aw_client-0.5.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aw_client-0.5.15-py3-none-any.whl | Python 3 | none | any | Details for aw_client-0.5.15-py3-none-any.whl |
Total release size: 42.3 kB
Release files / aw_client-0.5.15.tar.gz
| Download URL | aw_client-0.5.15.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6b0aeae82ded2dc0469b29109068d01ddf9e4195a5b7b8055849173b5edff7e
|
|
BLAKE2b-256 checksum How to use checksums |
f72210e30a013ae9f197194846966ebf38128a87c5249f6a475628d24f359938
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.9.9 Darwin/22.6.0
|
Release files / aw_client-0.5.15-py3-none-any.whl
| Download URL | aw_client-0.5.15-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d2a61d1d75e29d1e850aca1bc3390f40536929d361c7a891ed9fb394844ad50
|
|
BLAKE2b-256 checksum How to use checksums |
6a0c7003298b33a5fafefe786fca96dec2018829d4465c54313419ad5eb1ca10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.9.9 Darwin/22.6.0
|
Security for aw-client 0.5.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.