taskcheck 0.3.3.post1__tar.gz → 0.3.3.post3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: taskcheck
3
- Version: 0.3.3.post1
3
+ Version: 0.3.3.post3
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
7
  Requires-Dist: appdirs>=1.4.4
9
8
  Requires-Dist: icalendar>=6.0.1
10
9
  Requires-Dist: random-unicode-emoji>=2.8
@@ -40,7 +39,7 @@ It considers their estimated time to schedule all tasks starting from the most u
40
39
 
41
40
  #### UDAs
42
41
 
43
- Taskcheck leverages to UDAs, `estimated` and `time_map`. The `estimated` attribute is
42
+ Taskcheck leverages two UDAs, `estimated` and `time_map`. The `estimated` attribute is
44
43
  the expected time to complete the task in hours. The `time_map` is a comma-separated list of strings
45
44
  that indicates the hours per day in which you will work on a task (e.g. `work`, `weekend`, etc.).
46
45
  The exact correspondence between the `time_map` and the hours of the day is defined in the configuration
@@ -74,18 +73,8 @@ how much time you have to work on which task in which day. For
74
73
  instance:
75
74
 
76
75
  - `taskcheck -r today` will show the tasks planned for today
77
- - `taskcheck -r 1w` will show the tasks planned for the next week,
76
+ - `taskcheck -r 1w` will show the tasks planned for the next week
78
77
 
79
- ## Algorithm
80
-
81
- The algorithm allocates a fixed amount of time for each task (e.g. 1 hour) and then recomputes the
82
- urgency and restart the allocation procedure.
83
-
84
- If after 1 hour the long task has decreased urgency, that will be noticed and the newer most urgent
85
- task will get scheduled in its place.
86
-
87
- The minimum time for a task is by default 2 hours, but you can change it by tuning the `min_block`
88
- taskwarrior UDA.
89
78
 
90
79
  ## Configuration
91
80
 
@@ -132,6 +121,25 @@ include_unplanned = true # include unplanned tasks in the report in an ad-hoc se
132
121
  additional_attributes_unplanned = ["due", "urgency"] # additional attributes to show in the report for unplanned tasks
133
122
  ```
134
123
 
124
+ ## Algorithm
125
+
126
+ The algorithm simulates what happens if you work on a task for a certain time on a given day.
127
+
128
+ For each day X starting from today, it sorts the tasks by decreasing urgency.
129
+ It start from the most urgent tasks that can be allocated on day X depending on the task's
130
+ `time_map` and on your calendars. It allocates a few number of hours to the task,
131
+ then recomputes the urgencies exactly as Taskwarrior would do
132
+ if it was running on day X. Having recomputed the urgencies, it restarts.
133
+
134
+ If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
135
+ task will get scheduled in its place.
136
+
137
+ For `today`, taskcheck will skip the hours in the past -- i.e. if you're running at 12 pm, it will
138
+ skip all the available slots until 12 pm.
139
+
140
+ The maximum time that is allocated at each attempt is by default 2 hours
141
+ (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
142
+
135
143
  ## Tips and Tricks
136
144
 
137
145
  - You can exclude a task from being scheduled by removing the `time_map` or `estimated` attributes.
@@ -144,7 +152,3 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
144
152
  -i, --install: install taskcheck configuration
145
153
  -r, --report: show tasks planned until a certain time
146
154
  ```
147
-
148
- ## TODO
149
-
150
- - [ ] Consider due dates are nearer while planning in the future
@@ -27,7 +27,7 @@ It considers their estimated time to schedule all tasks starting from the most u
27
27
 
28
28
  #### UDAs
29
29
 
30
- Taskcheck leverages to UDAs, `estimated` and `time_map`. The `estimated` attribute is
30
+ Taskcheck leverages two UDAs, `estimated` and `time_map`. The `estimated` attribute is
31
31
  the expected time to complete the task in hours. The `time_map` is a comma-separated list of strings
32
32
  that indicates the hours per day in which you will work on a task (e.g. `work`, `weekend`, etc.).
33
33
  The exact correspondence between the `time_map` and the hours of the day is defined in the configuration
@@ -61,18 +61,8 @@ how much time you have to work on which task in which day. For
61
61
  instance:
62
62
 
63
63
  - `taskcheck -r today` will show the tasks planned for today
64
- - `taskcheck -r 1w` will show the tasks planned for the next week,
64
+ - `taskcheck -r 1w` will show the tasks planned for the next week
65
65
 
66
- ## Algorithm
67
-
68
- The algorithm allocates a fixed amount of time for each task (e.g. 1 hour) and then recomputes the
69
- urgency and restart the allocation procedure.
70
-
71
- If after 1 hour the long task has decreased urgency, that will be noticed and the newer most urgent
72
- task will get scheduled in its place.
73
-
74
- The minimum time for a task is by default 2 hours, but you can change it by tuning the `min_block`
75
- taskwarrior UDA.
76
66
 
77
67
  ## Configuration
78
68
 
@@ -119,6 +109,25 @@ include_unplanned = true # include unplanned tasks in the report in an ad-hoc se
119
109
  additional_attributes_unplanned = ["due", "urgency"] # additional attributes to show in the report for unplanned tasks
120
110
  ```
121
111
 
112
+ ## Algorithm
113
+
114
+ The algorithm simulates what happens if you work on a task for a certain time on a given day.
115
+
116
+ For each day X starting from today, it sorts the tasks by decreasing urgency.
117
+ It start from the most urgent tasks that can be allocated on day X depending on the task's
118
+ `time_map` and on your calendars. It allocates a few number of hours to the task,
119
+ then recomputes the urgencies exactly as Taskwarrior would do
120
+ if it was running on day X. Having recomputed the urgencies, it restarts.
121
+
122
+ If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
123
+ task will get scheduled in its place.
124
+
125
+ For `today`, taskcheck will skip the hours in the past -- i.e. if you're running at 12 pm, it will
126
+ skip all the available slots until 12 pm.
127
+
128
+ The maximum time that is allocated at each attempt is by default 2 hours
129
+ (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
130
+
122
131
  ## Tips and Tricks
123
132
 
124
133
  - You can exclude a task from being scheduled by removing the `time_map` or `estimated` attributes.
@@ -131,7 +140,3 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
131
140
  -i, --install: install taskcheck configuration
132
141
  -r, --report: show tasks planned until a certain time
133
142
  ```
134
-
135
- ## TODO
136
-
137
- - [ ] Consider due dates are nearer while planning in the future
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "taskcheck"
3
- version = "0.3.3-1"
3
+ version = "0.3.3-3"
4
4
  description = "Automatic scheduler for taskwarrior"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -14,3 +14,6 @@ dependencies = [
14
14
 
15
15
  [project.scripts]
16
16
  taskcheck = "taskcheck.__main__:main"
17
+
18
+ [tool.setuptools]
19
+ license-files = []
@@ -68,19 +68,19 @@ def install():
68
68
  ("urgency.uda.estimated.PT21H.coefficient", "10.38"),
69
69
  ("urgency.uda.estimated.PT22H.coefficient", "10.53"),
70
70
  ("urgency.uda.estimated.PT23H.coefficient", "10.67"),
71
- ("urgency.uda.estimated.PT24H.coefficient", "10.80"),
72
- ("urgency.uda.estimated.PT25H.coefficient", "10.93"),
73
- ("urgency.uda.estimated.PT26H.coefficient", "11.05"),
74
- ("urgency.uda.estimated.PT27H.coefficient", "11.16"),
75
- ("urgency.uda.estimated.PT28H.coefficient", "11.27"),
76
- ("urgency.uda.estimated.PT29H.coefficient", "11.37"),
77
- ("urgency.uda.estimated.PT30H.coefficient", "11.47"),
78
- ("urgency.uda.estimated.PT31H.coefficient", "11.56"),
79
- ("urgency.uda.estimated.PT32H.coefficient", "11.65"),
80
- ("urgency.uda.estimated.PT33H.coefficient", "11.73"),
81
- ("urgency.uda.estimated.PT34H.coefficient", "11.81"),
82
- ("urgency.uda.estimated.PT35H.coefficient", "11.89"),
83
- ("urgency.uda.estimated.PT36H.coefficient", "11.96"),
71
+ ("urgency.uda.estimated.P1D.coefficient", "10.80"),
72
+ ("urgency.uda.estimated.P1DT1H.coefficient", "10.93"),
73
+ ("urgency.uda.estimated.P1DT2H.coefficient", "11.05"),
74
+ ("urgency.uda.estimated.P1DT3H.coefficient", "11.16"),
75
+ ("urgency.uda.estimated.P1DT4H.coefficient", "11.27"),
76
+ ("urgency.uda.estimated.P1DT5H.coefficient", "11.37"),
77
+ ("urgency.uda.estimated.P1DT6H.coefficient", "11.47"),
78
+ ("urgency.uda.estimated.P1DT7H.coefficient", "11.56"),
79
+ ("urgency.uda.estimated.P1DT8H.coefficient", "11.65"),
80
+ ("urgency.uda.estimated.P1DT9H.coefficient", "11.73"),
81
+ ("urgency.uda.estimated.P1DT10H.coefficient", "11.81"),
82
+ ("urgency.uda.estimated.P1DT11H.coefficient", "11.89"),
83
+ ("urgency.uda.estimated.P1DT12H.coefficient", "11.96"),
84
84
  (
85
85
  "report.ready.columns",
86
86
  "id,start.age,entry.age,depends.indicator,priority,project,tags,recur.indicator,scheduled.relative,due.relative,until.remaining,description,urgency",
@@ -179,7 +179,7 @@ DEFAULT_EMOJI_KEYWORDS = {
179
179
 
180
180
 
181
181
  def get_tasks(config, tasks, year, month, day):
182
- regex = re.compile(rf"{year}-{month}-{day} - ([PDTHM0-9]+)")
182
+ regex = re.compile(rf"{year:04d}-{month:02d}-{day:02d} - ([PDTHM0-9]+)")
183
183
  valid_tasks = []
184
184
  for task in tasks:
185
185
  for line in task["scheduling"].split("\n"):
@@ -265,6 +265,10 @@ def generate_report(config, constraint, verbose=False):
265
265
  console = Console()
266
266
  tasks = fetch_tasks()
267
267
 
268
+ if config.get("include_unplanned"):
269
+ unplanned_tasks = get_unplanned_tasks(config, tasks)
270
+ display_unplanned_tasks(console, config, unplanned_tasks)
271
+
268
272
  for year, month, day in get_days_in_constraint(constraint):
269
273
  this_day_tasks = get_tasks(config, tasks, year, month, day)
270
274
 
@@ -272,10 +276,6 @@ def generate_report(config, constraint, verbose=False):
272
276
 
273
277
  display_tasks_table(console, config, this_day_tasks)
274
278
 
275
- if config.get("include_unplanned"):
276
- unplanned_tasks = get_unplanned_tasks(config, tasks)
277
- display_unplanned_tasks(console, config, unplanned_tasks)
278
-
279
279
 
280
280
  def fetch_tasks():
281
281
  """Fetch tasks from the task manager and return them as a JSON object."""
@@ -1,10 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: taskcheck
3
- Version: 0.3.3.post1
3
+ Version: 0.3.3.post3
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
7
- License-File: LICENSE
8
7
  Requires-Dist: appdirs>=1.4.4
9
8
  Requires-Dist: icalendar>=6.0.1
10
9
  Requires-Dist: random-unicode-emoji>=2.8
@@ -40,7 +39,7 @@ It considers their estimated time to schedule all tasks starting from the most u
40
39
 
41
40
  #### UDAs
42
41
 
43
- Taskcheck leverages to UDAs, `estimated` and `time_map`. The `estimated` attribute is
42
+ Taskcheck leverages two UDAs, `estimated` and `time_map`. The `estimated` attribute is
44
43
  the expected time to complete the task in hours. The `time_map` is a comma-separated list of strings
45
44
  that indicates the hours per day in which you will work on a task (e.g. `work`, `weekend`, etc.).
46
45
  The exact correspondence between the `time_map` and the hours of the day is defined in the configuration
@@ -74,18 +73,8 @@ how much time you have to work on which task in which day. For
74
73
  instance:
75
74
 
76
75
  - `taskcheck -r today` will show the tasks planned for today
77
- - `taskcheck -r 1w` will show the tasks planned for the next week,
76
+ - `taskcheck -r 1w` will show the tasks planned for the next week
78
77
 
79
- ## Algorithm
80
-
81
- The algorithm allocates a fixed amount of time for each task (e.g. 1 hour) and then recomputes the
82
- urgency and restart the allocation procedure.
83
-
84
- If after 1 hour the long task has decreased urgency, that will be noticed and the newer most urgent
85
- task will get scheduled in its place.
86
-
87
- The minimum time for a task is by default 2 hours, but you can change it by tuning the `min_block`
88
- taskwarrior UDA.
89
78
 
90
79
  ## Configuration
91
80
 
@@ -132,6 +121,25 @@ include_unplanned = true # include unplanned tasks in the report in an ad-hoc se
132
121
  additional_attributes_unplanned = ["due", "urgency"] # additional attributes to show in the report for unplanned tasks
133
122
  ```
134
123
 
124
+ ## Algorithm
125
+
126
+ The algorithm simulates what happens if you work on a task for a certain time on a given day.
127
+
128
+ For each day X starting from today, it sorts the tasks by decreasing urgency.
129
+ It start from the most urgent tasks that can be allocated on day X depending on the task's
130
+ `time_map` and on your calendars. It allocates a few number of hours to the task,
131
+ then recomputes the urgencies exactly as Taskwarrior would do
132
+ if it was running on day X. Having recomputed the urgencies, it restarts.
133
+
134
+ If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
135
+ task will get scheduled in its place.
136
+
137
+ For `today`, taskcheck will skip the hours in the past -- i.e. if you're running at 12 pm, it will
138
+ skip all the available slots until 12 pm.
139
+
140
+ The maximum time that is allocated at each attempt is by default 2 hours
141
+ (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
142
+
135
143
  ## Tips and Tricks
136
144
 
137
145
  - You can exclude a task from being scheduled by removing the `time_map` or `estimated` attributes.
@@ -144,7 +152,3 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
144
152
  -i, --install: install taskcheck configuration
145
153
  -r, --report: show tasks planned until a certain time
146
154
  ```
147
-
148
- ## TODO
149
-
150
- - [ ] Consider due dates are nearer while planning in the future
File without changes