# Worklog - Simple CLI util to track work hours
[![codecov](https://codecov.io/gh/dotcs/worklog/branch/develop/graph/badge.svg)](https://codecov.io/gh/dotcs/worklog)
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.
```bash
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.
```bash
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:
```bash
wl commit start --offset-minutes 5
wl commit stop --offset-minutes -5
```
Learn about all options by using the `--help` flag for any command:
```bash
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:
```bash
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](./worklog/config.cfg).
An example customized configuration could be the following file:
```ini
[workday]
hours_target = 8.5
hours_max = 12
```
### Integration in task bars
tbd
```bash
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:
```bash
pip install -e ".[testing]"
```
Run tests via
```bash
pytest worklog/
```
### Create a release
**Attention**: This should not be needed. Releases are auto-generated from the
*GitHub CI. See the [configuration file](./.github/workflows/package.yaml).
To create a release use [git flow](), update the version number in setup.py first.
Then execute the following commands:
```bash
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:
```bash
pip install --proxy=http://localhost:3128 dcs-worklog
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共42个文件
py:28个
txt:7个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:dcs-worklog-0.0.30.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
dcs-worklog-0.0.30.tar.gz (42个子文件)
dcs-worklog-0.0.30
MANIFEST.in 97B
PKG-INFO 5KB
worklog
constants.py 878B
parser.py 9KB
tests
test_breaks.py 2KB
test_parser.py 5KB
test_dispatcher.py 8KB
__init__.py 0B
utils
test_session.py 5KB
test_schema.py 1000B
test_formatting.py 2KB
test_logger.py 764B
test_tasks.py 7KB
__init__.py 635B
test_pager.py 1KB
test_time.py 3KB
__main__.py 62B
__init__.py 1KB
breaks.py 955B
log.py 19KB
utils
pager.py 469B
formatting.py 1KB
time.py 1KB
logger.py 373B
__init__.py 352B
schema.py 598B
tasks.py 3KB
session.py 2KB
dispatcher.py 2KB
config.cfg 767B
requirements_test.txt 17B
LICENSE 34KB
setup.cfg 38B
requirements.txt 6B
dcs_worklog.egg-info
PKG-INFO 5KB
requires.txt 36B
SOURCES.txt 1KB
entry_points.txt 36B
top_level.txt 8B
dependency_links.txt 1B
setup.py 1KB
README.md 3KB
共 42 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功