Skip to main content

Simple CLI tool to log work and projects

Project description

Worklog - Simple CLI util to track work hours

codecov

Worklog is a simple and straight-forward tool to track working times via CLI. It uses a plain text file as it's storage backend which makes it easy to process the logged information with other tools.

Getting started

You need to have Python >= 3.6 installed.

pip install dcs-worklog

Command Line Interface (CLI)

The tool registers itself as a CLI tool with the name wl (short for worklog).

It provides the basic commands to start and stop tracking work times.

wl commit start    # starts a new work session
wl commit stop     # stops a running session

It's also possible to give a time offset to the current time:

wl commit start --offset-minutes 5
wl commit stop --offset-minutes -5

Learn about all options by using the --help flag for any command:

wl commit --help   # show more options

To see how the current status of the worklog use the status command:

$ wl status

Status         : Tracking on
Total time     : 07:49:40 ( 98%)
Remaining time : 00:10:20 (  2%)
Overtime       : 00:00:00 (  0%)
End of work    : 17:18:27

To see historical entries use the log command:

wl log             # shows the last 10 records (latest first)
wl log --all       # shows all records  (latest first)

Configuration

By default the log file is written to ~/.worklog. The format is CSV with pipe symbols (|) as delimiters.

A working day is configured to have 8 hours. 2 hours are set as a (soft) limit for overtime.

This configuration can be changed by creating a config file in ~/.config/worklog/config. Partial changes are allowed and are merged with the default configuration.

An example customized configuration could be the following file:

[workday]
hours_target = 8.5
hours_max = 12

Integration in task bars

tbd

wl status --fmt '{status} | {remaining_time} (percentage}%'

Sanity check

The current log file can be sanity-checked with the doctor command. In case entries are missing the doctor command will tell so:

$ wl doctor
ERROR:worklog:Date 2020-04-08 has no stop entry.

Development

Clone this repository and install the development version:

pip install -e ".[testing]"

Run tests via

pytest worklog/

Create a release

Attention: This should not be needed. Releases are auto-generated from the *GitHub CI. See the configuration file.

To create a release use git flow, update the version number in setup.py first. Then execute the following commands:

python setup.py sdist bdist_wheel
twine upload --skip-existing -r pypi dist/*

Troubleshooting

If you are behind a proxy the installation might not work. In this case try to setup the proxy via the --proxy flag:

pip install --proxy=http://localhost:3128 dcs-worklog

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

dcs-worklog-0.0.27.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

dcs_worklog-0.0.27-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file dcs-worklog-0.0.27.tar.gz.

File metadata

  • Download URL: dcs-worklog-0.0.27.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for dcs-worklog-0.0.27.tar.gz
Algorithm Hash digest
SHA256 aa021cc86b3a068e9c2ad96ced00682b2bebecd84d708fe7f0c517966db892bd
MD5 bb465d9ec1c38ef0405ecbe30ea11c69
BLAKE2b-256 d3dc0eca5c8173ec9167aeefaf213ca13f1b7c94147b53f13204b182b25aba54

See more details on using hashes here.

File details

Details for the file dcs_worklog-0.0.27-py3-none-any.whl.

File metadata

  • Download URL: dcs_worklog-0.0.27-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for dcs_worklog-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 558e3b7ab9a2fd961fdcca027e1ad4d086822c7e5d6703cfd0a3813e93e118a8
MD5 7ae5850125b1bc934c32fdf7b5c869a1
BLAKE2b-256 4af4abb830420e483bebc4bf5e33114d407089d404ea2c5a73a0e9cfd2d1b9ee

See more details on using hashes here.

Supported by

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