Giter VIP home page Giter VIP logo

utt's Introduction

Ultimate Time Tracker

Ultimate Time Tracker (utt) is a simple command-line time tracking application written in Python.

Table of Contents

Quick Start

Prerequisites

utt requires Python version 3.7 or above.

Installing utt

Install utt from PyPI:

$ pip install utt

hello

Say hello when you arrive in the morning:

$ utt hello

add

Add a task when you have finished working on it:

$ utt add "programming"

report

Show report:

$ utt report

------------------------ Monday, Jul 08, 2013 (week 28) ------------------------

Working Time: 0h07
Break   Time: 0h00

----------------------------------- Projects -----------------------------------

(0h07) : programming

---------------------------------- Activities ----------------------------------

(0h07) : programming


----------------------------------- Details ------------------------------------

(0h07) 08:27-08:34 programming

edit

Edit your timesheet:

$ utt edit

Commands

hello

$ utt hello should be the first command you execute when you start your day. It tells utt that you are now tracking your time.

Example:

$ utt hello

add

When you have completed a task, add it to utt with the add command.

Example:

$ utt add programming

You add a task when you have completed it, not when you start doing it.

Activity Type

There are three types of activities: working, break and ignored. Working activities contribute to the working time, break activities to the break time and ignored activities to neither. This feature is very useful when viewing your timesheet with the report command as it enables utt to group your activities by type.

The activity type is defined by its name. If it ends with ** it's a break activity. If it ends with *** it's an ignored activity. Otherwise, it's a working activity.

Examples:

  • Working activity
$ utt add "task #4"
  • Break activity
$ utt add "lunch **"
  • Ignored activity
$ utt add "commuting ***"

edit

edit opens your timesheet in a text editor so you can edit it.

Example:

$ utt edit

utt opens the text editor defined by the environment variable $VISUAL and, if not set, by the environment variable $EDITOR. If neither is set, utt opens vi.

report

$ utt report shows your timesheet.

Examples:

  • Timesheet for today: $ utt report

  • Timesheet for a specific date: $ utt report 2018-03-25

  • Timesheet for a period: $ utt report --from 2018-10-22 --to 2018-10-26

Sections

There are four sections in a report. As we will see, each one is a aggregated view of the previous one.

  1. Summary: shows the report date and the total working and break time.

  2. Projects: groups activities by project. This is useful to track the total time by projects. We will see how to specify the project for an activity.

  3. Activities: groups activities by name. This is useful to track the total time worked on a task when you have worked on it multiple times.

  4. Details: timeline of your activities.

Let's look at an example. Let's say you entered those activities throughout the day:

$ utt hello
$ utt add "project-1: task-3"
$ utt add "project-2: task-2"
$ utt add "project-1: task-1"
$ utt add "lunch **"
$ utt add "project-2: task-2"
$ utt add "project-1: task-2"

And then you view your timesheet:

$ utt report

----------------------- Saturday, Nov 03, 2018 (week 44) -----------------------

Working Time: 7h00
Break   Time: 1h00

----------------------------------- Projects -----------------------------------

(5h00) project-1: task-1, task-2, task-3
(2h00) project-2: task-2

---------------------------------- Activities ----------------------------------

(2h15) project-1: task-1
(2h15) project-1: task-2
(0h30) project-1: task-3
(2h00) project-2: task-2

(1h00) : lunch **

----------------------------------- Details ------------------------------------

(0h30) 09:00-09:30 project-1: task-3
(0h15) 09:30-09:45 project-2: task-2
(2h15) 09:45-12:00 project-1: task-1
(1h00) 12:00-13:00 lunch **
(1h45) 13:00-14:45 project-2: task-2
(2h15) 14:45-17:00 project-1: task-2

The first section, the summary section, shows that you worked 7h and had a 1-hour break.

Then, the projects section shows that you worked 5h on project 1 and 2h on project 2. You can specify the project of an activity by prefixing it with a non-whitespace string followed by a colon (e.g project-1:, project2:).

The next section, the activities section, shows how long you worked on each activity. For instance, even though you worked twice on project-2: task-2 (0h15 + 1h45), it is shown once in that section.

Finally, the details section shows a timeline of all your activity.

Report Date

You can choose the report date by passing a date to the report command. The date must be either an absolute date formatted as "%Y-%m-%d" or a day of the week.

Examples:

Absolute date:

$ utt report 2013-07-01

Day of the week:

$ utt report monday

If today is Wednesday, Feb 18, the report date is Monday, Feb 16.

You can also specify a date range. All the activities will be aggregated for the given time period.

To report activities from 2013-07-01 00:00:00 to 2013-12-31 23:59:59 :

$ utt report --from 2013-07-01 --to 2013-12-31

To report activities since Monday:

$ utt report --from monday

Current Activity

A -- Current Activity -- is inserted if the current time is included in the report range.

The first duration between the parentheses (1h00) represents the working time without the current activity. The second duration between the parentheses (0h22) represents the duration of the current activity.

Example:

$ utt add "#12"
$ utt report

------------------------ Monday, Jul 08, 2013 (week 28) ------------------------

Working Time: 1h22 (1h00 + 0h22)
Break   Time: 0h00

----------------------------------- Projects -----------------------------------

(1h22) : #12, -- Current Activity --

---------------------------------- Activities ----------------------------------

(1h00) : #12
(0h22) : -- Current Activity --

...

You can change the current activity name with the --current-activity argument.

Example:

$ utt report --current-activity "#76"

------------------------ Monday, Jul 08, 2013 (week 28) ------------------------

Working Time: 1h22 (1h00 + 0h22)
Break   Time: 0h00

----------------------------------- Projects -----------------------------------

(1h22) : #12, #76

---------------------------------- Activities ----------------------------------

(1h00) : #12
(0h22) : #76

...

Or, you can remove the current activity with the --no-current-activity flag.

Example:

$ utt report --no-current-activity

------------------------ Monday, Jul 08, 2013 (week 28) ------------------------

Working Time: 1h00
Break   Time: 0h00

----------------------------------- Projects -----------------------------------

(1h00) : #12

---------------------------------- Activities ----------------------------------

(1h00) : #12

stretch

Stretch the latest task to the current time:

Example:

$ utt stretch
stretched 2013-07-08 08:34 programming
        → 2013-07-08 09:00 programming

Plugins

utt can be extended by installing plugins. Unfortunately, since this is a recent feature, no plugins have been listed here yet. Write to Mathieu Larose <[email protected]> to add your plugin here.

Plugin development

See docs/CONTRIBUTING.md#how-can-i-create-a-plugin how to create a utt plugin.

Configuration

Timezone

Warning: timezone is an experimental feature.

To enable timezone support, get the config filename:

$ utt config --filename
`/home/<user>/.config/utt/utt.cfg`

Then, open it with a text editor and change it so it looks like this:

[timezone]
enabled = true

Bash Completion

utt uses argcomplete to provide bash completion.

First, make sure bash-completion is installed:

  • Fedora: $ sudo dnf install bash-completion
  • Ubuntu: $ sudo apt-get install bash-completion

Then execute:

$ register-python-argcomplete utt >> ~/.bashrc

Finally, start a new shell.

Contributing

See docs/CONTRIBUTING.md for how to contribute to utt.

Contributors

License

utt is released under the GPLv3. See the LICENSE file for details.

Website

http://github.com/larose/utt

utt's People

Contributors

bourgeoisbear avatar dependabot-preview[bot] avatar dependabot[bot] avatar fighterpoul avatar ivanov avatar kitchoi avatar larose avatar mungerd avatar persebek avatar silvus avatar ukrutt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

utt's Issues

Uncaught exception when date in wrong format

If some utt functionality is used incorrectly, it provides quite a nice output like: "unrecognized argument" or something like this, however that's not the case with date usage in utt report.

To replicate simply run utt report 2022-02-20 or really anything that doesn't match %Y-%m-%d format.

The result will be:
Traceback (most recent call last): File "/opt/homebrew/bin/utt", line 8, in <module> sys.exit(main()) File "/opt/homebrew/lib/python3.9/site-packages/utt/__main__.py", line 9, in main main() File "/opt/homebrew/lib/python3.9/site-packages/utt/main.py", line 37, in main _v1._private.container[command.handler_class]() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 68, in __getitem__ return self._pipeline.execute(dependency_type) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 80, in execute return self._stages.execute(key) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in execute return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/middlewares.py", line 20, in execute return next_middleware() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in <lambda> return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in execute return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/middlewares.py", line 54, in execute dependency_value = next_middleware() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in <lambda> return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 107, in execute return self._middleware.execute(key, self._should_never_be_called) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 28, in execute dependencies = self._resolve_dependencies(dependency_spec.dependency_types) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 34, in _resolve_dependencies return [ File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 35, in <listcomp> self._resolve_dependency(dependency_type) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 68, in __getitem__ return self._pipeline.execute(dependency_type) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 80, in execute return self._stages.execute(key) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in execute return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/middlewares.py", line 20, in execute return next_middleware() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in <lambda> return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in execute return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/middlewares.py", line 54, in execute dependency_value = next_middleware() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in <lambda> return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 107, in execute return self._middleware.execute(key, self._should_never_be_called) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 28, in execute dependencies = self._resolve_dependencies(dependency_spec.dependency_types) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 34, in _resolve_dependencies return [ File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 35, in <listcomp> self._resolve_dependency(dependency_type) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 68, in __getitem__ return self._pipeline.execute(dependency_type) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 80, in execute return self._stages.execute(key) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in execute return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/middlewares.py", line 20, in execute return next_middleware() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in <lambda> return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in execute return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/middlewares.py", line 54, in execute dependency_value = next_middleware() File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 95, in <lambda> return self._middleware.execute(key, lambda: self._next_stage.execute(key)) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 107, in execute return self._middleware.execute(key, self._should_never_be_called) File "/opt/homebrew/lib/python3.9/site-packages/cargo/_container.py", line 29, in execute return dependency_spec.instantiate(*dependencies) File "/opt/homebrew/lib/python3.9/site-packages/utt/components/report_args.py", line 257, in report_args report_range = parse_report_range_arguments( File "/opt/homebrew/lib/python3.9/site-packages/utt/components/report_args.py", line 44, in parse_report_range_arguments report_date = parse_date(today, unparsed_report_date) File "/opt/homebrew/lib/python3.9/site-packages/utt/components/report_args.py", line 70, in parse_date return parse_absolute_date(datestring) File "/opt/homebrew/lib/python3.9/site-packages/utt/components/report_args.py", line 74, in parse_absolute_date return datetime.datetime.strptime(datestring, "%Y-%m-%d").date() File "/opt/homebrew/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/opt/homebrew/Cellar/[email protected]/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '324-4242-43' does not match format '%Y-%m-%d'

More desired behavior would be some user-friendly error message.

Weekly and monthly date reports

The daily report is useful but I need a weekly and/or a monthly report as well sometimes.

Here's a draft of how it would work with the report argument:

#1. would give us a report from 2014-01-01 to 2014-01-15
$ utt report --start-date=2014-01-01 --end-date=2014-01-15 
#2. the original report command without the --start-date and 
#    --end-date argument would have the same behavior as of now.
$ utt report
#3. the "weekly" string would fetch the current week's start and end dates and 
#    use the first example under the hood.
$ utt report weekly
#4. the "monthly" string would work the same way as the "weekly" one but 
#    with the correct start & end dates.
$ utt report monthly
#5. The same goes for "yearly"
$ utt report yearly

I'll work on this when I'll have some spare time.

How does it look to you ?

Bye ?

What about a 'bye' command, to leave, and end the last task ?

end day

In short, end the day, and keep track of the current task, if any.

So I just started using this. Forgive me if I missed it. What happens if you want to end tracking time before your done with your current task?

Allow spaces in project names?

Thank you for this excellent tool! I have a minor feature request: would it be possible to allow spaces in project names? I make heavy use of the "project: task" syntax, but my projects often naturally have spaces in:

Example:

$ utt add "test project: just testing"
$ utt add "galactic domination: buy pencils for death star sketches"

This currently works, but test_project and galactic domination aren't recognised as projects, and in the report I see something like:

(0h46)    : -- Current Activity --, galactic domination: buy paper for death star blueprint, test project: just testing

If the idea seems reasonable, I'm happy to take some time to try to create a PR.

Show total time

Hello,

I think it could be good to have the total time (working + break time) in the report, just above Working Time (or where you want).

btw thanks a lot for this tool!

Python version requirements

I am (happily) using utt 1.22 with Python 3.7. It mostly works perfectly, however utt report --week fails with an

AttributeError: type object 'datetime.date' has no attribute 'fromisocalendar'

This function was added in Python 3.8.

Not sure if this is a mistake or if Python 3.8 is intended to be the minimum required version, in which case may I suggest to add a python_requires setting to setup() and update Pipfile

Thanks for putting this package together!

Time zone changes not supported

When one travels to another time zone, they can get the following error when getting a report:

Traceback (most recent call last):
  File "/usr/local/bin/utt", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/utt/__main__.py", line 46, in main
    handler(args)
  File "/Library/Python/2.7/site-packages/utt/cmd_report.py", line 42, in execute
    report_date, util.entries_from_file(args.data_filename))
  File "/Library/Python/2.7/site-packages/utt/cmd_report.py", line 88, in _filter_and_group_entries
    all_entries))
  File "/Library/Python/2.7/site-packages/utt/util.py", line 40, in entries_from_file
    (i, previous_entry, new_entry))
Exception: Error line 44. Not in chronological order: 2018-08-07 19:49 break** > 2018-08-07 19:35 project

If the latter entry was logged 14 minutes later, the error would not happen and the report would be wrong, with or without the user noticing it.

I would propose logging with time zones. For backward compatibility (and for those who never cares), timestamps without time zones will be treated in local time zone. Would that be okay? I can open a pull request to fix this. My colleagues and I travel a lot as part of our job.

Multi-tagging of activities

I'm interested in the possibility of tasks being assigned multiple tags, or perhaps more specifically to be associated with a project and also tagging. Let's say my morning looks something like this:

  • (meeting) project-1: widget-1 design
  • (meeting) project-2: database upgrade
  • (coding) project-2: database upgrade

I'd like to be able to generate reports that tell me:

  1. project-based summaries: how much time was spent on project-1, project-2, etc
  2. "action"-based summaries: how much time was spent in meetings, coding, etc.

I know it's possible to enter tasks into utt to satisfy either goal (1) (prefixing with project-1, project-2) or (2) (prefixing with email, coding, etc.), but not both simultaneously.

I think enabling both types of reporting would require defining an additional mark-up convention. Quickly brainstorming, some possibilities are:

  1. utt add "project-1,meeting: widget-1 design" (project name required to be first in the list or everything becomes a tag and the user must sort it out later?)
  2. utt add "project-1: widget-1 design [meeting]" (secondary tag in brackets at the end)
  3. utt add "project-1[meeting]: widget-1 design"

I opened the issue to get some feedback on:

  1. the general concept and whether others would find this useful
  2. whether this is something best added into utt itself, or as a separate plugin. In the latter case, something like syntax brainstorm (2) is probably desirable, as it wouldn't affect utt usage without the plugin.

The addition of "action" tagging (not the ideal name, but I don't want to confuse with "Activities" as used in the utt docs) could affect the "Activities" section of the report, and it's not immediately obvious how to handle this. In generating a report on the activities described at the top, would "(meeting) project-2: database upgrade" and "(coding) project-2: database upgrade" be summed in the "Activities" section of the report as "project-2: database upgrade" or would they be listed separately? It's not immediately obvious to me which way this should go.

stretch --merge option

I think about a feature (available via an option of stretch command?):
I would like to stretch by modifying the last entry instead of adding a new one.
Is it possible?

Feature request: "per_task" type of CSV report

Hello guys, thanks for the awesome tool you've created!
I'm rather hardcore UTT user and it would be extremely helpful to extend a bit the CSV reports, for they can be nicely "piped" into tools such as csvlens (utt ... --csv-section ... | csvlens). Now there is actually only per_day "mode" which is not entirely helpful in analyzing a particular day(s) in details.

The proposition would be to have per_task that will print a bit detailed overview, i.e.:

Tasks,Project,Date,Duration,
"coding","awesome project",2023-10-24,1h55
"meeting","awesome project",2023-10-24,1h55
"reviewing","awesome project",2023-10-24,1h55

csvlens print:

────────────────────────────────────────────────────────────────────────────────
      Tasks        Project            Date          Duration
───┬────────────────────────────────────────────────────────────┬───────────────
1  │  coding       awesome project    2023-10-24    1h55        │
2  │  meeting      awesome project    2023-10-24    1h55        │
3  │  reviewing    awesome project    2023-10-24    1h55        │

I could help in contributing if you find it worth including in the main package.

Some individual integration tests fail

I'm working on adding some tests for a PR, and thought I'd get familiar with how to run the integration tests individually. A few of them fail, with different failure modes. Examples below, for report-no-current-activity and report-1

% make test-integration INTEGRATION_CMD=report-no-current-activity
:
>> REPORT-NO-CURRENT-ACTIVITY
mkdir -p `dirname /root/.local/share/utt/utt.log`
cp data/utt-no-current-activity.log /root/.local/share/utt/utt.log
bash -c 'diff <(utt --now "2018-08-21 20:00" report 2018-08-20) data/utt-no-current-activity.stdout'
bash: utt: command not found
:
Makefile:109: recipe for target 'report-no-current-activity' failed
make: *** [report-no-current-activity] Error 1
make: *** [test-integration-py2] Error 2
% make test-integration INTEGRATION_CMD=report-1
:
>> REPORT-1
cp data/utt-1.log /root/.local/share/utt/utt.log
cp: cannot create regular file '/root/.local/share/utt/utt.log': No such file or directory
Makefile:90: recipe for target 'report-1' failed
make: *** [report-1] Error 1
make: *** [test-integration-py2] Error 2

But some pass, like report-dayname:

% make test-integration INTEGRATION_CMD=report-dayname
:
>> REPORT-DAYNAME
utt --now "2015-2-16 12:00" report thursday | grep ^- | head -n 1 | diff data/report/dayname -
<< REPORT-DAYNAME

Configurable log location

Hi! I think it would be great if it was possible to configure a custom location for the log file.

Working with utf8 coding to represent german characters.

Very useful project and it works perfectly as long as you write your tasks in english. But since I'm German I would prefer to log my activities in German, which includes using characters like ü, ä, ö and so on. This means having the log-file in a format like utf-8. Do you have any idea on how to achieve this easily?

I tried the following up until now and don't know if I only made a mess:

When the file is created by the first hello command it is encoded with charset=us-ascii. Once I add a line using a German symbol the encoding changes to charset=iso-8859-1.

I tried to force your python scripts to work in utf-8 coding using:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
but this solves the problem only for the report-command:
grafik

when using the edit-command the file still does not display the characters correctly, even though the editor is set to utf-8 coding:
2019-01-30 13:22 hello
2019-01-30 13:23 ���

Now i can force the file to be charset=utf-8 using the command line and then the problem is fixed in the editor of course:
2019-01-30 13:22 hello
2019-01-30 13:23 äöü
but then the report-command is messed up again:
grafik

If you have any ideas for an easy solution I would be very happy and I believe other people from all over the world might be interested to simply change the coding maybe in the .config file, to cope with different language-specific characters.
Thanks in advance!

Add a flag to display 'Details' section when running `report --from<> --to<>`

Hi @larose + contributors,

thank you for developing and sharing this great tool!

I skimmed through the source code to try and figure out how to add this feature myself.
Your python skills are way more pythonic than mine however, and I didn't get very far.
Edit: Completing #18 will probably take my Python skills to the next level - so thanks for that. I might be able to add this feature myself!

Here is what I wanted to do:

  • adding a new -d (for details) argument
    utt report --from 2019-07-12 --to 2019-07-13 -d
  • desired output:
------ Friday, Jul 12, 2019 (week 28) to Saturday, Jul 13, 2019 (week 28) ------

Working Time: 15h00
Break   Time: 0h00


----------------------------------- Projects -----------------------------------

(15h00) OS: Bring tutors up to speed, create google forms for  
new student repos, setting up course (Github website/repos  
etc + liasing with staff to organise things), Update website, write  
script to create new student repos, write script to delete old  
repos, write script to scrape and backup old homework repos

---------------------------------- Activities ----------------------------------

(1h00) OS: Bring tutors up to speed
(1h00) OS: create google forms for new student repos
(5h00) OS: setting up course (Github website/repos etc + liasing with staff to organise things)
(1h00) OS: Update website
(5h00) OS: write script to create new student repos
(1h00) OS: write script to delete old repos
(1h00) OS: write script to scrape and backup old homework repos


----------------------------------- Details ------------------------------------
2019-07-12:
(5h00) 12:00-17:00 OS: setting up course (Github website/repos etc + liasing with staff to organise things)

2019-07-13 :
(1h00) 12:00-13:00 OS: Update website
(1h00) 13:00-14:00 OS: Bring tutors up to speed
(1h00) 14:00-15:00 OS: write script to scrape and backup old homework repos
(1h00) 15:00-16:00 OS: write script to delete old repos
(1h00) 16:00-17:00 OS: create google forms for new student repos
(5h00) 17:00-22:00 OS: write script to create new student repos

The date separated activities aren't important. I guess having:

 ...
----------------------------------- Details ------------------------------------
(5h00) 12:00-17:00 OS: setting up course (Github website/repos etc + liasing with staff to organise things)
(1h00) 12:00-13:00 OS: Update website
(1h00) 13:00-14:00 OS: Bring tutors up to speed
(1h00) 14:00-15:00 OS: write script to scrape and backup old homework repos
(1h00) 15:00-16:00 OS: write script to delete old repos
(1h00) 16:00-17:00 OS: create google forms for new student repos
(5h00) 17:00-22:00 OS: write script to create new student repos

is fine too.

Mainly, this feature would allow one to see the actual date-time of the hours worked.

I could achieve this with a script that reads the contents of utt.log,
formats the outputt to look like the 'Details' section, and finally printing it after calling
utt report --from<> --to<>.

Something like this:

note this is just pseudo code

from os import system
import sys


# make a file that holds the desired output
output=open('output.txt','w+') 

#Get the time period as argument to script:
from_date = sys.argv[1]
to_date = sys.argv[2]

# Get time period (pseudo code)
period = to_date - from_date

#store the detailed activities here:
details = []

# Go through utt.log lookng for matching dates (psseudo code)
f='utt.log'
with open(f) as file_object:
    for line in file_object:
        if(line is within period):
        	details.append(line.rstrip()) # add activities occring in period


# run the report command as it is now:
run = "utt report --from "+from_date+" --to "+to_date
sys(run>>output.txt) # put the output in a textfile, we don't want it printing to terminal just yet...


# add the details that we got earlier, to the output file;
st = '----------------------------------- Details ------------------------------------\n'
output.write(st)
for d in details:
	output.write(d+"\n")


output.close()
# finally output everything to the terminal
sys("cat output.txt")

This is a hack though, and I'm quite sure you'd be able to do this far easier and more elegantly
knowing the source code structure 😋
Thanks again for this awesome tool.

Why doesn't the Activity Report account for time spent in tasks started in the previous day?

I am phrasing this as a question instead of an issue because I don't know it this is intended

Suppose you have a log like the following

2020-12-29 23:00 Task A

2020-12-30 00:20 Task B

When I get the report with utt report, in the ActivitiesView report, Task B will account for 20 minutes instead of 80 minutes. It seems to be counting from midnight instead of when the task actually started - in the previous day, before midnight; this feels incorrect IMO.

Feature request : report a date

So basically I have this bash script : utt report --to=$1 --from=$1 that helps me to fill reports of time tracking for my boss.

It would be cool if we could do utt report --date XXXXXX instead.

Also I have to do this for the whole month, so it would be even cooler if utt would print a whole month report (with --from and --to set at month boundaries) but displaying time per-day/per-project instead of only per-day (with a --per-project option for instance).

What do you think of this ?

Say "bye"

Just an idea to leave: In the morning I say "hello", why not say "bye" in the evening? I am new to the software and I do not want it to record my sleeping time as work time, so I thought about that. Or do you have another idea and already solved this?

UTT 1.9 does not run on Win10

I'm running Python 3.7.0 using WinPython. I use Pipenv (v2018.10.13) to create/run my virtual environments.

I have been successfully running UTT 1.7 for quite some time without any problems at all. I decided to check for any updates, of which there was one to UTT 1.9. Ran the update through Pipenv to bring it up to the current version.

However since updating, Win10 does not recognise the 'utt' command any more. If I roll back to 1.8, the 'utt' command works as intended, just not in version 1.9.

I looked in the virtualenv Scripts folder, and notice that 'utt' does not become a Windows executable file. A file appears for utt, but Windows doesn't recognise it. Not sure what happened between 1.8 and 1.9 to cause this.

utt_1 9

I'm happy to help where I can to find out why this has happened.

Report for "one month"

It would be convenient to be able to report for "a month" at a time.

Of course, this is already possible to do (--from 2019-10-01 --to 2019-10-31 for October) but it would be convenient to be able to do just utt report --month 2019-10 or utt report --month Oct.

It would be pretty easy to implement the --month command line switch. However it would be even more user friendly if we could write utt report Oct.

Is there any interest in this? Which is the better approach? --month switch or automatic parsing?

(In either case I volunteer to do the work!)

UPDATE: Solved in #25.

Say goodbye?

Say hello when you arrive in the morning:
$ utt hello

How does it know when you leave at night?

OSError: [Errno 22] Invalid argument (When deleting content of report-file)

When trying to run utt hello after manually deleting all the content in the report-file. I did this to start over.

The error comes from add_entry.py on line 26. If the report-file is empty you can't put the cursor on position -1

with open(filename, "rb+") as file:
    file.seek(-1, os.SEEK_END)  # if the file is empty, position -1 will cause OSError
   ...

I fixed it by catching the exception and ignoring the issue, whilst setting;

prepend_new_line = False

I'm creating a pull request for it. Just in case

Export working times in excel sheet

I am interested in exporting my working times as an excel-sheet, or even better just as a csv. Does utt offer this ootb? Otherwise it would be great if such functionality would be added.

This would make it way easier to import the times in other tools like asana or jira. Any chance this is planned in the near future?

Git-based version of utt

Hi,

I'm working on a feature that allows one to log hours on multiple machines.
It requires the user to create a repo on github or gitlab where the most up to date version of
the utt.log file is stored.

Check out my fork of utt for more info.

This is a work in progress and far from being ready for a pull request.
Just though I'd let you know.

Cheers

Problem when using incorrect python version

On my operating system debian 9 there is python 3.5.3 installed by default. When now running utt 1.21 I get the following exception:

> utt hello
Traceback (most recent call last):
  File "/home/user/.local/bin/utt", line 7, in <module>
    from utt.__main__ import main
  File "/home/user/.local/lib/python3.5/site-packages/utt/__main__.py", line 34
    commands: Commands = _v1._private.container[Commands]
            ^
SyntaxError: invalid syntax

When having a look to the Pipfile I can see that python 3.7 is required. https://github.com/larose/utt/blob/master/Pipfile

It would be great to have some kind of proper exception message in case a not supported version is used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.