Skip to content

Commit 911e373

Browse files
Merge pull request #68 from dvklopfenstein/dox
Added documentation
2 parents f5bf90d + 7e86e87 commit 911e373

File tree

10 files changed

+191
-31
lines changed

10 files changed

+191
-31
lines changed

doc/mkdocs/mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ site_url: https://dvklopfenstein.github.io/timetracker/
33
docs_dir: source
44
site_dir: ../../site
55
theme:
6+
#name: mkdocs
67
name: readthedocs
78
custom_dir: docs_theme
89
static_templates:
910
- index.html
11+
#palette:
12+
# scheme: slate
13+
# primary: green
1014
watch:
1115
- source
1216
- docs_theme
@@ -15,6 +19,8 @@ extra_css:
1519
- assets/colors.css
1620
- assets/theme.css
1721
- assets/highlight.css
22+
#extra_templates:
23+
# - sitemap.xml
1824
markdown_extensions:
1925
- admonition
2026
repo_url: https://github.com/dvklopfenstein/timetracker/
@@ -32,6 +38,7 @@ nav:
3238
- Basic Usage: usage_basic.md
3339
- Advanced Usage: usage_advanced.md
3440
- Pandas: pandas.md
41+
- Invoicing: invoicing.md
3542
- 'Reference':
3643
- Global configuration File: config_global.md
3744
- 'Community':

doc/mkdocs/sitemap.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://dvklopfenstein.github.io/timetracker/</loc>
5+
<lastmod>2025-06-13</lastmod>
6+
</url>
7+
<url>
8+
<loc>https://dvklopfenstein.github.io/timetracker/config_global/</loc>
9+
<lastmod>2025-06-13</lastmod>
10+
</url>
11+
<url>
12+
<loc>https://dvklopfenstein.github.io/timetracker/config_local/</loc>
13+
<lastmod>2025-06-13</lastmod>
14+
</url>
15+
<url>
16+
<loc>https://dvklopfenstein.github.io/timetracker/contributing/</loc>
17+
<lastmod>2025-06-13</lastmod>
18+
</url>
19+
<url>
20+
<loc>https://dvklopfenstein.github.io/timetracker/installation/</loc>
21+
<lastmod>2025-06-13</lastmod>
22+
</url>
23+
<url>
24+
<loc>https://dvklopfenstein.github.io/timetracker/invoicing/</loc>
25+
<lastmod>2025-06-13</lastmod>
26+
</url>
27+
<url>
28+
<loc>https://dvklopfenstein.github.io/timetracker/overview/</loc>
29+
<lastmod>2025-06-13</lastmod>
30+
</url>
31+
<url>
32+
<loc>https://dvklopfenstein.github.io/timetracker/pandas/</loc>
33+
<lastmod>2025-06-13</lastmod>
34+
</url>
35+
<url>
36+
<loc>https://dvklopfenstein.github.io/timetracker/reference-command-line/</loc>
37+
<lastmod>2025-06-13</lastmod>
38+
</url>
39+
<url>
40+
<loc>https://dvklopfenstein.github.io/timetracker/tips-and-tricks/</loc>
41+
<lastmod>2025-06-13</lastmod>
42+
</url>
43+
<url>
44+
<loc>https://dvklopfenstein.github.io/timetracker/usage_advanced/</loc>
45+
<lastmod>2025-06-13</lastmod>
46+
</url>
47+
<url>
48+
<loc>https://dvklopfenstein.github.io/timetracker/usage_basic/</loc>
49+
<lastmod>2025-06-13</lastmod>
50+
</url>
51+
</urlset>

doc/mkdocs/source/BingSiteAuth.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<users>
3+
<user>BAB0C9F21E51CAD68E6B0385C807FBE2</user>
4+
</users>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-site-verification: google2188449bc9879cec.html

doc/mkdocs/source/index.md

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,70 @@ Copyright (C) DV Klopfenstein, PhD
33
License: https://www.gnu.org/licenses/agpl-3.0.en.html#license-text
44
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
55
-->
6-
# Timetracker-csv
7-
[![PyPI - Version](https://img.shields.io/pypi/v/timetracker-csv)](https://pypi.org/project/timetracker-csv)
8-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14803225.svg)](https://doi.org/10.5281/zenodo.14803225)
9-
![GitHub License](https://img.shields.io/github/license/dvklopfenstein/timetracker)
6+
<p align="center" style="display:inline">
7+
<h1 align="center">Timetracker-csv</h1>
8+
<h3 align="center">Pandas-friendly time tracking from the CLI, repo by repo</h3>
9+
<h3 align="center">
10+
<a href="https://pypi.org/project/timetracker-csv"><img src="https://img.shields.io/pypi/v/timetracker-csv" alt="PyPI - Version"></a> |
11+
<a href="https://doi.org/10.5281/zenodo.14803226"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.14803226.svg" alt="DOI"></a> |
12+
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html"><img src="https://img.shields.io/github/license/dvklopfenstein/timetracker" alt="License"></a>
13+
</h3>
14+
<pre align="center" style="font-family: monospace; font-size: larger; border: 1px solid #ccc; padding: 10px; display: inline-block;">
15+
┌────────────────────────────┐
16+
│ 🕒 Timetracker CLI Tool │
17+
│ Track time → CSV → pandas │
18+
└────────────────────────────┘
19+
</pre>
20+
</p>
1021

1122
Track time spent on multiple projects,
1223
one repo at a time from the [CLI](https://blog.iron.io/pros-and-cons-of-a-command-line-interface)
1324

1425
Time is saved in
15-
[pandas](https://pandas.pydata.org/pandas-docs/stable/index.html)-friendly
26+
[pandas](https://pandas.pydata.org/pandas-docs/stable/index.html)-friendly plaintext
1627
[CSV](https://www.datarisy.com/blog/understanding-csv-files-use-cases-benefits-and-limitations) files
1728

1829
<p align="center"><img src="https://github.com/dvklopfenstein/timetracker/raw/main/doc/mkdocs/source/images/stopwatch.png" alt="timetracker" width="750"/></p>
1930

31+
## Description
32+
Timetracker is a
33+
lightweight, privacy-respecting CLI tool
34+
that logs your work sessions into
35+
clean, pandas-friendly CSV files.
36+
Whether you're juggling multiple projects or
37+
just want a no-fuss way to monitor your productivity,
38+
Timetracker keeps your data local, editable, and analysis-ready.
39+
* No cloud. No surveillance.
40+
* Human-readable logs perfect for Python and pandas workflows.
41+
* Quick to set up, easy to use, and fully open source.
42+
* Supports free-form messages, optional activity types, and tag metadata
43+
2044
## Quickstart
21-
The `name` used by this time tracker is determined
22-
by the `USER` environmental variable by default.
23-
In this example, the username is "bez."
45+
The username of the researcher running this timer is "bez."
46+
The project repository (repo) name is "meetinghouse."
2447
```sh
2548
#----------------------------------------------------
2649
# 1) Initialize a timetracker project
27-
$ cd /home/bez/meetinghouse
50+
$ cd /home/bez/projs/meetinghouse
2851

29-
$ trk init
30-
Initialized timetracker directory: /home/bez/meetinghouse/.timetracker
52+
$ trk init --csvdir doc/
53+
Initialized timetracker directory: /home/bez/projs/meetinghouse/.timetracker
3154

3255
#----------------------------------------------------
3356
# 2) Start the timer
3457
$ trk start
3558
Timetracker started now: Mon 09:00 AM: 2025-03-24 09:00:00
59+
```
3660

61+
Initializing with the option `--csvdir doc/` will cause time units to be written to
62+
a csv file stored in the `doc/` directory,
63+
rather than in the default repo root directory.
64+
```sh
3765
#----------------------------------------------------
3866
# 3) Stop the timer
3967
$ trk stop -m 'Received instructions'
4068
Timer stopped at Mon 2025-03-24 12:00:00 PM
41-
Elapsed H:M:S 0:03:00 appended to timetracker_meetinghouse_bez.csv
69+
Elapsed H:M:S 0:03:00 appended to doc/timetracker_meetinghouse_bez.csv
4270

4371
#----------------------------------------------------
4472
# 4a) Report my time units for this project
@@ -47,7 +75,7 @@ Day Date Span Total Description
4775
Sun 2025-03-24 03:00 03:00 Received instructions
4876

4977
#- - - - - - - - - - - - - - - - - - - - - - - - - -
50-
# 4b) You can also get the total hours that you spent on a project:
78+
# 4b) Get my total hours spent on the project:
5179
$ trk hours
5280
0:03:00 H:M:S or 3.000 hours
5381
```

doc/mkdocs/source/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $ cd /home/bez/projects/meetinghouse
2626
$ trk init
2727
Ran `git add .timetracker/config .timetracker/.gitignore`
2828
Initialized project directory: /home/bez/projects/meetinghouse/.timetracker
29-
Added project to the global timetracker config: /home/dvklo/.timetrackerconfig:
29+
Added project to the global timetracker config: /home/bez/.timetrackerconfig:
3030
project: meetinghouse; config: /home/bez/projects/meetinghouse/.timetracker/config
3131
```
3232
### 2) Start the timer

doc/mkdocs/source/invoicing.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Invoicing
2+
3+
----------------------------------------------------------------------------------
4+
## Quickstart invoicing
5+
### Mark timeslots as `Billable`
6+
To mark an item as billable, use the `--billable` or `-b` option in the `stop` command:
7+
```sh
8+
$ trk start
9+
Timetracker started at: Wed 08:00 AM: 2025-06-04 08:00:00
10+
11+
$ trk stop --billable --message "Defined meetinghouse project goals, budget, and timeline"
12+
or
13+
$ trk stop -b -m "Defined meetinghouse project goals, budget, and timeline"
14+
Timetracker stopped at: Wed 2025-06-04 05:00:00 PM: 2025-06-04 17:00:00
15+
Elapsed H:M:S 9:00:00 appended to timetracker_meetinghouse_bez.csv
16+
```
17+
18+
### Get an invoice of billable items
19+
All items `tag`ed with `Billable` will be included in the invoice:
20+
```sh
21+
```
22+
23+
----------------------------------------------------------------------------------
24+
## Advanced invoicing
25+
To create an invoice for a project while the current working directory
26+
is not in the time-tracked repo, use the `--trk-dir` option:
27+
```sh
28+
$ trk --trk-dir ../antimicrobial_stewardship/.timetracker/ invoice
29+
WROTE: report.docx
30+
```
31+

doc/mkdocs/source/usage_advanced.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@ Under construction...
33

44

55
## Initialize a project
6-
To begin, initialize your project for timetracking:
6+
To begin, initialize your project for timetracking with `trk init`:
77
```sh
88
# Initialize project for timetracking
99
$ trk init
1010
Ran `git add .timetracker/config .timetracker/.gitignore`
1111
Initialized project directory: /home/bez/projects/meetinghouse/.timetracker
12-
Added project to the global timetracker config: /home/dvklo/.timetrackerconfig:
12+
Added project to the global timetracker config: /home/bez/.timetrackerconfig:
1313
project: timetracker; config: /home/bez/projects/meetinghouse/.timetracker/config
1414
```
1515

1616
### Initializing runs `git add`
17-
If the project is git-managed, timetracker runs:
18-
`git add .timetracker/config .timetracker/.gitignore`.
17+
If the project is git-managed, timetracker runs
18+
`git add .timetracker/config .timetracker/.gitignore`,
19+
which adds these timetracker files to your project's git repo:
20+
* `.timetracker/config`
21+
* '.timetracker/.gitignore'
1922
Use the `--no-git-add` option inhibit running `git add`.
2023
```sh
2124
$ trk init --no-git-add
2225
Initialized project directory: /home/bez/projects/meetinghouse/.timetracker
23-
Added project to the global timetracker config: /home/dvklo/.timetrackerconfig:
26+
Added project to the global timetracker config: /home/bez/.timetrackerconfig:
2427
project: timetracker; config: /home/bez/projects/meetinghouse/.timetracker/config
2528
```
2629

doc/mkdocs/source/usage_basic.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@ License: https://www.gnu.org/licenses/agpl-3.0.en.html#license-text
44
-->
55

66
# Basic Usage #
7-
**Timetracker-csv** tracks time one project repository at a time.
7+
**Timetracker-csv** tracks time one project repository (repo) at a time.
88

99
For a list of **timetracker-csv** commands, enter `trk --help`.
1010

1111
## Projects ##
12-
A project repository is a directory that contains
13-
project files and project sub-directories.
14-
1512
**Timetracker-csv** works seemlessly
1613
with projects that are version-managed with `git`.
1714
But it also works with any project.
1815

19-
If you use `git`, then each git-managed project repository
16+
If you use `git`, then each git-managed project repository (repo)
2017
will also be a trk-managed project.
2118
This means that time will be saved in separate
22-
CSV files for separate projects.
19+
CSV files for separate repos.
2320

2421
Multiple CSV files can be combined
2522
into a single CSV file
@@ -75,7 +72,7 @@ To begin, initialize your project for timetracking:
7572
$ trk init
7673
Ran `git add .timetracker/config .timetracker/.gitignore`
7774
Initialized project directory: /home/bez/projects/meetinghouse/.timetracker
78-
Added project to the global timetracker config: /home/dvklo/.timetrackerconfig:
75+
Added project to the global timetracker config: /home/bez/.timetrackerconfig:
7976
project: timetracker; config: /home/bez/projects/meetinghouse/.timetracker/config
8077
```
8178

@@ -174,7 +171,6 @@ $ timestr "2025-03-01T15:55-04:00"
174171
```
175172

176173
### Track your time
177-
178174
Use the `start` and `stop` commands to record time:
179175
```sh
180176
$ trk start --at 9am
@@ -217,6 +213,45 @@ Mon 2025-03-31 00:30 05:30 Began crafting a chest from Acacia wood to stor
217213
Mon 2025-03-31 02:00 07:30 Covered chest in gold
218214
```
219215

216+
## Show running timers
217+
Show all timers that are currently running in either
218+
the default concise format or the verbose format.
219+
220+
### Concise format
221+
Bez is the researcher whose username is `bez`.
222+
Bez is currently working on three projects:
223+
`architecture`, `stonecutting`, and `cabinetry`.
224+
225+
The command, `trk running` will show
226+
the day and time that the timer was started (`Tue 2025-07-15 11:56:17 AM`) and
227+
the elapsed time in hours, minutes, and seconds (`H:M:S 1:04:45`).
228+
229+
```sh
230+
$ trk running
231+
Began Tue 2025-07-15 11:56:17 AM -> H:M:S 1:04:45 by bez for architecture
232+
Began Tue 2025-07-15 11:35:40 AM -> H:M:S 1:25:22 by bez for stonecutting
233+
Began Tue 2025-07-15 12:00:00 PM -> H:M:S 1:01:03 by bez for cabinetry
234+
3 of 37 projects have running timers; listed in: /home/bez/.timetrackerconfig
235+
```
236+
237+
### Verbose format
238+
Using `--verbose` will show the directory for each project that has a running timer.
239+
In this example, each project directory is in the `/home/bez/projs/` directory.
240+
```sh
241+
$ architecture running -v
242+
Began Tue 2025-07-15 11:56:17 AM -> H:M:S 1:06:35 by bez for architecture
243+
/home/bez/projs/architecture
244+
245+
Began Tue 2025-07-15 11:35:40 AM -> H:M:S 1:27:12 by bez for stonecutting
246+
/home/bez/projs/stonecutting
247+
248+
Began Tue 2025-07-15 12:00:00 PM -> H:M:S 1:02:53 by bez for cabinetry
249+
/home/bez/projs/cabinetry
250+
251+
3 of 37 projects have running timers; listed in: /home/bez/.timetrackerconfig
252+
```
253+
254+
220255
## Activities
221256
There is one `Activity` column in each CSV file.
222257
For example, to add the activity, `docs`, to a time unit do:

makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
MAKEFLAGS := --no-print-directory
22

33
PYTHON := python3
4-
CSV := /home/dvklo/timetrackers/timetracker_trk_dvklo.csv
4+
CSV := ~/timetrackers/timetracker_trk_dvklo.csv
5+
6+
dox:
7+
find doc/mkdocs
58

69
install:
710
pip install .
@@ -70,9 +73,6 @@ csv:
7073
hours:
7174
trk --trk-dir $(DIRTRK) hours
7275

73-
docx:
74-
trk --trk-dir $(DIRTRK) report -o $(CSV) -o timetracker.docx
75-
7676

7777
files:
7878
@grep -nH --color filename $(DIRTRK)/config

0 commit comments

Comments
 (0)