Skip to content

Calculate and print spent time for a project from taskwarrior

License

Notifications You must be signed in to change notification settings

fmeynadier/tasktime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

tasktime

tasktime reads information of a project from taskwarrior and calculates, how much time was spent with this project. tasktime can print CSV or readable output.

Usage

./tasktime.py [parameters...]

Parameters

-h, --help              Show help message
-b BEGIN_DATE, --begin BEGIN_DATE
                        Begin timesheet on YYYY-MM-DD, default = 1970-01-01
-e END_DATE, --end END_DATE 
                        End time accounting on YYYY-MM-DD, default = today
 -p {this-day,this-week,this-month,this-year,last-day,last-week,last-month,last-year}, --period {this-day,this-week,this-month,this-year,last-day,last-week,last-month,last-year}
                        Period (overrides dates)
-c, --csv               Print output in CSV format
-n, --null              Print also tasks without time information (default: no)
-t, --task [cmd]        Change task command
-v, --version           Print version and exit
--full                  print full task breakdown (default : only print
                        totals)
--project PROJECT       Project for which the active time is computed
                        Contrary to previous versions, this is optional :
                        By default, all projects that had an activity
                        within the given timespan will be taken into
                        account.
-x EXCLUDE, --exclude EXCLUDE
                        Exclude project (may be used more than once)

Prepare taskwarrior

You have to add journal.time=on to your taskwarrior configuration (.taskrc). Taskwarrior will save start and stop annotations from now on. This annotations are evaluated by tasktime.

Note time with taskwarrior

taskwarrior has the operations start and stop. This information is used to calculate the spent time. You have to start and stop the tasks you work on.

Example:

task 2 start

# Work on task 2...

task 2 stop

Examples

TODO : add v2 examples.

Default output

./tasktime.py cool-project

Output:

Project: cool-project

Do something cool
    Duration: 00:13:05
Do something really cool
    Duration: 02:18:35

Sum: 02:31:40

Print also tasks without time

./tasktime.py -n cool-project

Output:

Project: cool-project

Do something cool
    Duration: 00:13:05
Do something boring
Do something really cool
    Duration: 02:18:35

Sum: 02:31:40

CSV output

./tasktime.py -c cool-project

Output:

"Project","cool-project"
"",""
"Description","Duration (hours)"
"",""
"Do something cool","00:13:05"
"Do something really cool","02:18:35"
"",""
"Sum","02:31:40"

Contact and copyright

Sven Hertle <[email protected]>

tasktime is distributed under the MIT license. See http://www.opensource.org/licenses/MIT for more information.

About

Calculate and print spent time for a project from taskwarrior

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%