source: stamper/docs/_build/html/_sources/using.txt@ 44:5f48fc9d6e7d

Last change on this file since 44:5f48fc9d6e7d was 44:5f48fc9d6e7d, checked in by Borja Lopez <borja@…>, 10 years ago

Added charts generation documentation

Added information on how to get the list of full arguments on the command
line for the stamps tool

File size: 5.2 KB
Line 
1How to use it
2=============
3
4.. contents::
5
6
7Recording time
8--------------
9
10To start recording time::
11
12 stamp
13
14To stop recording time::
15
16 stamp ID DESCRIPTION
17
18where:
19
20- **ID** is a string **without spaces** identifying a customer, project,
21 group of tasks or any other thing you want to use to group your stamps
22
23- **DESCRIPTION** is a description of what you did
24
25for example::
26
27 stamp stamper writing documentation
28
29or::
30
31 stamp stamper implementing per-month line charts
32
33
34Recording consecutive stamps
35++++++++++++++++++++++++++++
36
37Imagine you start working on a project, you *stamp* your start::
38
39 stamp
40
41and then you finish a given task, so you *stamp* it::
42
43 stamp stamper writing installation instructions
44
45but then, you keep yourself working on the same project, but on some other
46task. You don't have to *stamp* the start time again, you simply *stamp* again
47when you finish the work on that other task::
48
49 stamp stamper writing usage instructions
50
51.. note::
52
53 This apply also for changing to another project, you don't have to *stamp*
54 the start time again, just keep stamping the end times. In such a situation,
55 Stamper will take the end time of a recorded stamp as the start time of the
56 next one.
57
58
59Retrieving information from the existing stamps
60-----------------------------------------------
61
62Total times
63+++++++++++
64
65- Get a list of total times stamped per **ID**::
66
67 stamps
68
69- Get the total times stamped for a given **ID**, for example, **stamper**::
70
71 stamps stamper
72
73- Get the total times stamped for the **ID** **stamper** during the last
74 week::
75
76 stamps stamper 1w
77
78 .. seealso::
79
80 *1w* is a date-based filter. You can learn more about those filters
81 in the :ref:`date_based_filtering` documentation below.
82
83Per day details
84+++++++++++++++
85
86- Get a list of detailed per-day times::
87
88 stamps -v
89
90- Get details for a given **ID**, for example, **stamper**::
91
92 stamps -v stamper
93
94- Get details for a given month, for example, *august 2014*::
95
96 stamps -v 2014-08-01--2014-09-01
97
98 .. seealso::
99
100 *2014-08-01--2014-09-01* is a date-based filter. You can learn more about
101 those filters in the :ref:`date_based_filtering` documentation below.
102
103Timeline
104++++++++
105
106You can get a *timeline* of all the stamped stamps::
107
108 stamps -t
109
110This *timeline* will show each stamp in a line, in a similar way to what bebu's
111stamp [1]_ stores in its text-based file::
112
113 2014-08-12 12:33 start
114 2014-08-12 12:51 stamper writing installation instructions
115 2014-08-12 13:11 stamper writing usage documentation
116 2014-08-13 09:33 start
117 2014-08-13 12:12 stamper adding missing tests for the cli tools
118
119You can filter the timeline by **ID**::
120
121 stamps -t stamper
122
123And/or by date::
124
125 stamps -t 2m
126
127 .. seealso::
128
129 *2m* is a date-based filter. You can learn more about those filters
130 in the :ref:`date_based_filtering` documentation below.
131
132
133Charts
134++++++
135
136You can generate some nice charts from your stamps. So far only bar charts
137showing the total time per day can be generated, but you can filter them by
138**ID** and/or date. Some examples:
139
140- Render a chart of all the times already stamped, by **ID**::
141
142 stamps -g
143
144- Render a chart of the stamps for the last 4 days::
145
146 stamps -g 4d
147
148- Render a chart of the stamps for the **ID** *stamper* for the last week::
149
150 stamps -g stamper 1w
151
152.. note::
153
154 The charts will be saved into **~/.workstamps-charts**, in SVG_ format.
155 The name of the chart will be generated based on the current date and
156 time, and a *symbolic link* called **chart-latest.svg** will be created,
157 pointing to the latest chart generated.
158
159
160stamps - full List of arguments
161-------------------------------
162
163You can get the full list of arguments from the command line too::
164
165 stamps -h
166
167or::
168
169 stamps --help
170
171.. argparse::
172 :module: stamper.cli
173 :func: build_args_parser
174 :prog: stamper
175
176
177.. _date_based_filtering:
178
179Date-based filtering
180--------------------
181
182Most of the results returned by the *stamps* tool can be filtered using the
183following date-based filters:
184
185- **YYYY-MM-DD**: Limit the results to only those stamps stamped on this date::
186
187 stamps -v 2014-08-13
188
189 ::
190
191 stamps -t stamper 2014-08-13
192
193- **YYYY-MM-DD\***: Limit the results to only those stamps stamped **after this
194 date**. For example, this will show per-day details for stamps stamped after
195 the first of august, 2014::
196
197 stamps -v 2014-08-01*
198
199- **\*YYYY-MM-DD**: Limit the results to only those stamps stamped **before this
200 date**. For example this will show the total time stamped for project stamper
201 before the first of january, 2014::
202
203 stamps stamper *2014-01-01
204
205- **YYYY-MM-DD--YYYY-MM-DD**: Limit the results to only those stamps stamped in
206 a date **between those dates**. For example, this will show the *timeline* for
207 july, 2014::
208
209 stamps -t 2014-07-01--2014-08-01
210
211- **nD|W|M|Y**: Limit the results to only those stamps stamped since n *days*
212 (**D**), *weeks* (**W**), *months* (**M**) or *years* (**Y**) ago.
213 For example, this will show the details for the last month::
214
215 stamps -v 1m
216
217 .. note::
218
219 It does not matter if you provide *d|w|m|y* or *D|W|M|Y*. The filters are
220 handled in a case-insensitive way.
221
222
223.. _SVG: http://en.wikipedia.org/wiki/Scalable_Vector_Graphics
224
225.. [1] http://repos.betabug.ch/stamp
Note: See TracBrowser for help on using the repository browser.