- OCaml 97.3%
- Makefile 2.7%
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"
- The header line is ignored
- The column containing iso-date will be located (columns before that will be ignored).
- The date will be extracted, it must be in iso-8601-format (YYYY-MM-DD)
- 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
-wsums will be collected grouped into weeks-dsums 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