{"id":13530544,"url":"https://github.com/ActivityWatch/aw-client","last_synced_at":"2025-04-01T18:31:57.558Z","repository":{"id":37998240,"uuid":"56850164","full_name":"ActivityWatch/aw-client","owner":"ActivityWatch","description":"Client library for ActivityWatch","archived":false,"fork":false,"pushed_at":"2024-10-23T12:19:35.000Z","size":597,"stargazers_count":43,"open_issues_count":11,"forks_count":44,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T00:54:46.916Z","etag":null,"topics":["activitywatch","client","library","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ActivityWatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ActivityWatch"],"open_collective":"activitywatch","liberapay":"ActivityWatch","custom":["https://activitywatch.net/donate/"]}},"created_at":"2016-04-22T11:19:48.000Z","updated_at":"2024-10-23T12:19:40.000Z","dependencies_parsed_at":"2024-11-06T07:30:27.555Z","dependency_job_id":"84087d69-2862-42ba-9498-76671e5af280","html_url":"https://github.com/ActivityWatch/aw-client","commit_stats":{"total_commits":304,"total_committers":16,"mean_commits":19.0,"dds":0.3421052631578947,"last_synced_commit":"16ff14f169e84b0ab75cf4704562aaa8bc7e83eb"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ActivityWatch%2Faw-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ActivityWatch","download_url":"https://codeload.github.com/ActivityWatch/aw-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246691637,"owners_count":20818543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activitywatch","client","library","python"],"created_at":"2024-08-01T07:00:51.578Z","updated_at":"2025-04-01T18:31:57.273Z","avatar_url":"https://github.com/ActivityWatch.png","language":"Python","readme":"aw-client\n=========\n\n[![GitHub Actions badge](https://github.com/ActivityWatch/aw-client/workflows/Build/badge.svg)](https://github.com/ActivityWatch/aw-client/actions)\n[![PyPI](https://img.shields.io/pypi/v/aw-client)](https://pypi.org/project/aw-client/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Typechecking: Mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n\nClient library for ActivityWatch in Python.\n\nPlease see [the documentation][docs] for usage, and take a look at `examples/`.\n\n - [Documentation][docs]\n - [API Reference][apiref]\n\n[docs]: https://docs.activitywatch.net/en/latest/\n[apiref]: https://docs.activitywatch.net/en/latest/api/python.html#aw-client\n\n## How to install\n\nInstall from pip: `pip install aw-client`\n\nInstall the latest version directly from github without cloning: `pip install git+https://github.com/ActivityWatch/aw-client.git`\n\nTo install from a cloned version:\n\n - clone repo: `git clone https://github.com/ActivityWatch/aw-client.git`\n - cd into the directory: `cd aw-client`\n - run `poetry install` (will create a virtualenv, if none activated)\n   - 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).\n\n## Usage\n\nFor the CLI:\n\n```\n$ aw-client --help\nUsage: aw-client [OPTIONS] COMMAND [ARGS]...\n\n  CLI utility for aw-client to aid in interacting with the ActivityWatch\n  server\n\nOptions:\n  --host TEXT     Address of host\n  --port INTEGER  Port to use\n  -v, --verbose   Verbosity\n  --testing       Set to use testing ports by default\n  --help          Show this message and exit.\n\nCommands:\n  buckets    List all buckets\n  canonical  Query 'canonical events' for a single host (filtered,...\n  events     Query events from bucket with ID `bucket_id`\n  heartbeat  Send a heartbeat to bucket with ID `bucket_id` with JSON `data`\n  query      Run a query in file at `path` on the server\n  report     Generate an activity report\n```\n\n\n## Debugging\n\n* Run python with `LOG_LEVEL=debug` to get additional debugging output\n* If invalid events have been queued for submission, you may need to delete the file-based queues generated by this library\n* To use the development version of this library use `aw-client = {path = \"../aw-client\" }` in `pyproject.toml`\n\n## Examples\n\nThe [`examples/`](examples/) directory contains a couple of example scripts, including:\n\n - [`time_spent_today.py`](examples/time_spent_today.py) - fetches all non-afk events and sums their duration to get the total active time for the day.\n - [`working_hours.py`](https://github.com/ActivityWatch/aw-client/blob/master/examples/working_hours.py) - computes hours worked per day (matching a \"work\" category rule), and exports matching events to a JSON file (for auditing).\n - [`load_dataframe.py`](https://github.com/ActivityWatch/aw-client/blob/master/examples/load_dataframe.py) - loads events from a host using a categorizing \u0026 AFK-filtering query, put result in a pandas dataframe, and export as CSV.\n - [`merge_buckets.py`](examples/merge_buckets.py) - merges two buckets with non-intersecting events by moving all events from one into the other.\n - [`redact_sensitive.py`](examples/redact_sensitive.py) - redact sensitive events.\n","funding_links":["https://github.com/sponsors/ActivityWatch","https://opencollective.com/activitywatch","https://liberapay.com/ActivityWatch","https://activitywatch.net/donate/"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FActivityWatch%2Faw-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FActivityWatch%2Faw-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FActivityWatch%2Faw-client/lists"}