User Guide (R of CRUD) - Retrieve Your Data.¶
Currently Timerdo has to ways to retrieve your data through CLI entry points. The first way is the standard way of doing it. The second way has two goals: to give you total freedom and control over your own data and to work as compatible output to pipe as input into another CLI application.
Technicalities
When using CLI applications, it is quite common to use different applications in sequence. Output from one application is used as input to another application. Connecting applications is like building a "pipeline" so you need to use "pipes" (> or >>) to direct an output as an input to the next application. I'll show an example when explaining the query
Timerdo command.
Report¶
report
is the standard way to retrieve your data. It has one print pattern
that you already know and 5 options to fine-tune your report. Here we'll stick to the
code blocks as they are easier to show off things and don't clutter the documentation,
but remember that the real one is fancier than this one.
report
group your tasks per tag
. In the example below we have three different
tags, thus 3 different tables.
Report Time frame¶
In the second line of the report we have the time frame that was took into consideration to
generate the report. Every timer
within the time frame was added to generate the report.
You can set the lower boundary with --init
(shortcut: -i
) and the upper boundary with --end
(shortcut: -e
).
Warning
-
The range is mathematically defined as [initial; final). Which means that all timers equal to or greater than the initial one are considered, but only timers less than the final one are considered.
-
Timers
are defined by date plus time, however you can define the frame using only date, consequently your time is predefined to00:00
and you need to always define the next day to aggregate all Previous day'stimers
. -
If you don't set the upper boundary it will print today as default, but in this case it'll take into account all
timers
in the table.
Report per tag¶
The header of each table (lines 5, 17 and 27) is represented by the tag
in which the tasks were grouped
and the total amount of time spent in the tag
, in other words, the sum of all times spent in each task
tagged the same way.
You can filter your report by tag with the option --tag
(shortcut: -t
).
Tip
You can pass how many tags
you want using the option --tag
for each tag
.
Report done tasks¶
When you call the report with no options, Timerdo will only report uncompleted tasks,
but you may need to have also an overview of all tasks. You can flag the --done
(shortcut: -d
)
option to print also Done
tasks.
Order tasks¶
You can order or tasks by date
, deadline
, status
and task
using the option --order-by
(-o
) combined with the flag --asc
(-a
) to ascending order.
Query¶
Using the query
command, Timerdo gives you superpowers to retrieve your data. This command has only one argument (script
) which you can pass any sql script to Timerdo to query your data and create your report. This command generates a JSON that you can also pipe to another application.
The following command queries your Timer table and saves it as JSON to a file in your working directory.
Technicalities
Timerdo has a SQLite database with two tables: timer_list
and todo_list
.
You can see the models below.
Config¶
Under construction 
Up to this point, you cannot save your configuration for reporting or querying your data. Timerdo already has this in mind, but it hasn't been implemented yet.
Planned steps:
- Create a TOML config layout.
- upgrade
report
andquery
to read config file.
If you are interested in the next "Technicalities" you can see how Timerdo has already a function to read the config file and how it finds and saves this file.
Technicalities
When installing Timerdo and calling it for the first time, Timerdo will try to connect to your database in a default directory (depends on your operating system). If it fails, Timerdo will create the folder and database for you. In order to have full control of your data and be able to move your database or delete the entire Timerdo, you need to know how to find your database. Below I reproduce part of the script that Timerdo uses to manipulate its database.