Skip to main content

Worklog

A personal time-tracking system.

Worklog provides a simple mechanism for logging in and out of accounts which are billed for time elapsed. The author, a professor, uses it to bill time to various commitments. Some really are paid hourly (e.g. consulting), but most are not. The primary use is to track and analyze how time is spent.

Installation

Worklog can be easily installed using pipx:

pipx install worklog-cli

or, if you use uv:

uv tool install worklog-cli

You will also need to install hledger.

Usage

If you are just getting started, make a list of the ways you spend time (or at least those you want to track). If you want to nest accounts, separate them with colons. For example, here are a few of my accounts:

 research:grants
 research:projects
 research:pubs
 research:reading
 research:lab
 teaching:planning
 service:advising
 identity:website
 identity:network
 overhead:email
 overhead:waste
 overhead:admin

Now run work. You will be asked to log in to an account, and then to enter a description of the work you are doing. (Accounts can be auto-completed using tab.)

% work
Log in to account: research:reading
Work description: Writing the Worklog README
[Enter to log out]

Press enter when you finish that work session, and you will be prompted to log in to another account. Press Control + C when you are finished. That's it!

While entering an account name, press Tab to autocomplete; if there's more than one match, press Tab again to list the possibilities.

Commands

The base command is work, which enters a loop for logging in and out of accounts. There are several other modes available:

  • work report (or work r) shows work statistics and quits. By default it shows daily balances for the past week, but this can be adjusted:
    • Append an account name to restrict the report to that account, e.g. work report research:reading.
    • -b/--begin and -e/--end set the date range (hledger date syntax), e.g. work report -b 2026-01-01 -e 2026-02-01.
    • --daily, --weekly, --monthly, or --yearly change how balances are grouped, e.g. work report --monthly.
  • work edit (or work e) opens the current worklog for editing. Sometimes I find I need to edit the worklog to add a work session or change times (for example, if I forgot to log out before going to bed).
  • work archive FILENAME (or work a FILENAME) archives the current worklog at the given filename and starts a new worklog. If you plan to log your work over time, I suggest you keep your log files in version control.

Configuration

Worklog follows the XDG Base Directory convention. A configuration file is automatically created at $XDG_CONFIG_HOME/worklog/config (~/.config/worklog/config by default), and worklog data is stored at $XDG_DATA_HOME/worklog/worklog.timeclock (~/.local/share/worklog/worklog.timeclock by default). If you have an existing ~/.worklog directory from an older version of Worklog, it will automatically be migrated to these locations the first time you run work.

[WORKLOG]
logfile = /Users/me/.local/share/worklog/worklog.timeclock
editor = vim

Formats

Worklog relies on hledger, a Haskell implementation of ledger, for double-entry bookkeeping which regards time as a resource just like money. One main design goal of this system is a human-readable ledger format which can also be parsed by scripts.

Development

This project uses uv for dependency management and packaging.

uv sync              # create a virtualenv and install dependencies
uv run work           # run the CLI from source
uv build              # build the sdist and wheel into dist/
uv publish            # upload to PyPI

Download files

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

Source Distribution

worklog_cli-2.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

worklog_cli-2.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file worklog_cli-2.0.0.tar.gz.

File metadata

  • Download URL: worklog_cli-2.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for worklog_cli-2.0.0.tar.gz
Algorithm Hash digest
SHA256 cf3f9daa8f9e543415bd6014eeb8544bb97e2e8916b89e1408765b671691da01
MD5 4191c2a5681ee47bffc97b2534df44e1
BLAKE2b-256 efc8e0f6f957944ac9d6fb2831772a38991244dfe01cb8ec16404d6b770b8bd4

See more details on using hashes here.

File details

Details for the file worklog_cli-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: worklog_cli-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for worklog_cli-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2c2c5a938d8ee151edf3fb39899f3f1bebbe4053f4a1ef040b076ddbc52c1bd
MD5 6955e72fbfab47fa10725068e1e0238d
BLAKE2b-256 e525832e6ec6973b7cabeda9ef59182c9498b6a21086f19c1b20f51706685c0a

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.0

2 files

This release

2.0.0 This release

2 files

1.0.0

2 files

0.0.5

1 file

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page