1
0
Fork
You've already forked wtcalc
0
Working Time Calculator
  • OCaml 97.3%
  • Makefile 2.7%
2026年02月22日 07:37:37 +01:00
cli.ml Info added for the format of cli-args s, e and g. 2025年11月18日 03:21:50 +01:00
date.ml Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
date.mli Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
extract.ml Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
extract.mli Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
io.ml Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
LICENSE Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
main.ml star + goal given, end-time calculated: using Times.wrap() 2025年09月29日 22:27:00 +02:00
Makefile Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
OCamlMakefile Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00
README.md command line args in examples: switches directly after 2026年02月22日 07:37:37 +01:00
times.ml Revert "Result of Times.add() fed into wrap()" 2025年09月29日 22:25:24 +02:00
times.mli Initial (main), orphaned from older master (started in July 2024) 2025年03月01日 06:06:18 +01:00

WTCalc - Working Time Calculator

Calculating working times from a csv source.

Additionally also calculate start/end/goal time directly via command line.

Input Format

The formatting of the input file must be similar to this:

 "some_text","date","start_time","end_time","project","description"
 "foo","2024年08月01日","12:15","14:00","Supertool","Details"
 "bar","2024年08月01日","14:45","17:30","Supertool","Details"
 "baz","2024年08月02日","13:00","15:00","Supertool","Details"
 "baz","2024年09月02日","14:00","01:00","Supertool","blah"
 "baz","2024年09月04日","16:25","18:40","Supertool","blah"
 "baz","2024年09月18日","11:10","11:40","Supertool","very special"
 "baz","2024年09月18日","14:40","22:00","Supertool","blah again"
 "baz","2024年09月18日","23:15","00:15","Supertool","blah again"
  1. The header line is ignored
  2. The column containing iso-date will be located (columns before that will be ignored).
  3. The date will be extracted, it must be in iso-8601-format (YYYY-MM-DD)
  4. The two columns following the date will be extracted and interpreted as start/end time (HH:MM).

Example Results

If you saved the example above in a file mytimes.csv, then you will get the following results if you use wtcalc:

No extra arguments: cumulatively summing up all entries

myhost $ wtcalc mytimes.csv
CumSum over all entries:
2024年08月01日 12:15 - 14:00 01:45 01:45 KW-31
2024年08月01日 14:45 - 17:30 02:45 04:30 KW-31
2024年08月02日 13:00 - 15:00 02:00 06:30 KW-31
2024年09月02日 14:00 - 01:00 11:00 17:30 KW-36
2024年09月04日 16:25 - 18:40 02:15 19:45 KW-36
2024年09月18日 11:10 - 11:40 00:30 20:15 KW-38
2024年09月18日 14:40 - 22:00 07:20 27:35 KW-38
2024年09月18日 23:15 - 00:15 01:00 28:35 KW-38

Argument -w for cumulatively summing up per week

myhost $ wtcalc -w mytimes.csv
CumSum over weekly entries:
2024年08月01日 12:15 - 14:00 01:45 01:45 KW-31
2024年08月01日 14:45 - 17:30 02:45 04:30 KW-31
2024年08月02日 13:00 - 15:00 02:00 06:30 KW-31
2024年09月02日 14:00 - 01:00 11:00 11:00 KW-36
2024年09月04日 16:25 - 18:40 02:15 13:15 KW-36
2024年09月18日 11:10 - 11:40 00:30 00:30 KW-38
2024年09月18日 14:40 - 22:00 07:20 07:50 KW-38
2024年09月18日 23:15 - 00:15 01:00 08:50 KW-38

Argument -d for cumulative summing up per day

myhost $ wtcalc -d mytimes.csv
CumSum over daily entries:
2024年08月01日 12:15 - 14:00 01:45 01:45 KW-31
2024年08月01日 14:45 - 17:30 02:45 04:30 KW-31
2024年08月02日 13:00 - 15:00 02:00 02:00 KW-31
2024年09月02日 14:00 - 01:00 11:00 11:00 KW-36
2024年09月04日 16:25 - 18:40 02:15 02:15 KW-36
2024年09月18日 11:10 - 11:40 00:30 00:30 KW-38
2024年09月18日 14:40 - 22:00 07:20 07:50 KW-38
2024年09月18日 23:15 - 00:15 01:00 08:50 KW-38

Command Line Switches

  • no switches: all working time is added up
  • -w sums will be collected grouped into weeks
  • -d sums will be collected grouped into days
  • -s: start time (HH:MM)
  • -e: end time (HH:MM)
  • -g: goal time (HH:MM)
  • -mindate: smallest date (filtering) that is used; format yyyy-mm-dd
  • -maxdate: highest date (filtering) that is used; format yyyy-mm-dd

The switches -s, -e and -g are used to do some ad-hoc calculation of time-diffs.

These calculations do not interfere with the working time calculated from the csv file. They can be used to calculate start/end/goal time to know when you have closing time, after you know when to start and how much time your goal is. But also calculating the other way around is possible.

Needed Software / Building

Needed Software:

  • OCaml installation
  • Calendar Library
  • CSV library

You may install these via OPAM (OCaml Package Manager).

Build:

In the directory of the repository type make. This should compile wtcalc.

There is no installation procedure, so simply place the program in for example your $HOME/bin/ directory (and set your $PATH variable accordingly).

Author / License

Author: Oliver Bandel

License: GPLv3