Skip to main content

Export ActivityWatch data to TimeWarrior with rule-based tag categorization

Project description

Better Categorizer and Timewarrior Companion

Problem: ActivityWatch collects great data, but it's hard to get useful insights from it.

Solution: Rule-based categorization that transforms raw ActivityWatch events into meaningful tags with multiple output options.

Currently this script exports data from ActivityWatch into TimeWarrior, but I'm planning to let this be a general categorization/tagging tool with possibility to store things in different backends, possibly including to work as a watcher and reexport data back into ActivityWatch.

What it does

  • Categorizes ActivityWatch events using configurable rules (browser URLs, editor files, app names, tmux sessions)
  • Exports categorized activity to TimeWarrior for time tracking
  • Report and analyze commands to aid the user into tweaking the rules and configuration and reexporting the data.

Installation

pip install aw-export-timewarrior

Requirements

  • Modern python - 3.13+ according to the pyproject.toml, but it may probably work on elder versions as well.
  • ActivityWatch with aw-watcher-window running
  • TimeWarrior installed

Optional Watchers

For richer tag extraction, install additional watchers:

Support for other watchers may be considered, reach out by email or add an issue or pull request for it.

Quick Start

# Continuous sync mode
aw-export-timewarrior sync

# Compare ActivityWatch data with TimeWarrior (dry-run)
aw-export-timewarrior diff --day yesterday

# Apply suggested changes
aw-export-timewarrior diff --day yesterday --apply

# Gain insight into events and rules
aw-export-timewarrior report --from '2 hours ago' --show-rule
aw-export-timewarrior analyze --day yesterday --limit 30

Configuration

Configuration is stored in ~/.config/activitywatch/aw-export-timewarrior/aw-export-timewarrior.toml.

Rule Types

  • Browser rules (rules.browser.*): Match URLs with url_regexp
  • Editor rules (rules.editor.*): Match by project name or path_regexp
  • App rules (rules.app.*): Match by app_names and title_regexp
  • Tmux rules (rules.tmux.*): Match by session, window, command, path
  • Tag rules (tags.*): Transform tags with add, remove, replace operations
  • Exclusive rules (exclusive.*): Prevent conflicting tags from combining

Example Configuration

[rules.browser.github]
url_regexp = "github\\.com"
tags = ["coding", "github"]

[rules.editor.myproject]
path_regexp = "/home/user/projects/myproject"
tags = ["myproject", "coding"]

[rules.app.slack]
app_names = ["slack", "Slack"]
tags = ["communication", "slack"]

[tags.coding-is-work]
source_tags = ["coding"]
add = ["4WORK"]

[exclusive.afk]
tags = ["afk", "not-afk"]

Commands

Command Description
sync Continuous sync from ActivityWatch to TimeWarrior
diff Compare and generate correction commands
report Show activity report with tags
analyze Analyze events without exporting
timeline Show side-by-side ActivityWatch vs TimeWarrior
validate Validate configuration file

Use --help with any command for detailed options.

Documentation

Background

This tool bridges ActivityWatch (automatic activity tracking) and TimeWarrior (manual time tracking). See the blog posts for rationale:

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aw_export_timewarrior-0.0.0.tar.gz (87.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aw_export_timewarrior-0.0.0-py3-none-any.whl (94.0 kB view details)

Uploaded Python 3

File details

Details for the file aw_export_timewarrior-0.0.0.tar.gz.

File metadata

  • Download URL: aw_export_timewarrior-0.0.0.tar.gz
  • Upload date:
  • Size: 87.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aw_export_timewarrior-0.0.0.tar.gz
Algorithm Hash digest
SHA256 aa06ebdb3694b53954363df69859d6de6e094d60b757f355521161a1602db814
MD5 61cdb1d42189977913a31faf2b090ecc
BLAKE2b-256 c8da3696fb52a9d324b704440a6f99aeaa34bf698d37c20780c465870ae26b5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aw_export_timewarrior-0.0.0.tar.gz:

Publisher: publish.yml on tobixen/aw-export-timewarrior

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aw_export_timewarrior-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aw_export_timewarrior-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 befc9b5376f473d0d16b204b1fad315972fd7528a943e237388b4ea34e60cb24
MD5 4fd62b517b72c5eaa411e6bee7af2819
BLAKE2b-256 6789738931cc6069a14301d57b5bf0413c6d65a7ad38304b8c358ed82dcc266e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aw_export_timewarrior-0.0.0-py3-none-any.whl:

Publisher: publish.yml on tobixen/aw-export-timewarrior

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page