taskcheck 0.3.3.post2__tar.gz → 0.4.0__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.4
2
2
  Name: taskcheck
3
- Version: 0.3.3.post2
3
+ Version: 0.4.0
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,25 +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 simulates what happens if you work on a task for a certain time on a given day.
82
-
83
- For each day X starting from today, it sorts the tasks by decreasing urgency.
84
- It start from the most urgent tasks that can be allocated on day X depending on the task's
85
- `time_map` and on your calendars. It allocates a few number of hours to the task,
86
- then recomputes the urgencies exactly as Taskwarrior would do
87
- if it was running on day X. Having recomputed the urgencies, it restarts.
88
-
89
- If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
90
- task will get scheduled in its place.
91
-
92
- For `today`, taskcheck will consider as allocated the hours already past.
93
-
94
- The maximum time that is allocated at each attempt is by default 2 hours
95
- (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
96
78
 
97
79
  ## Configuration
98
80
 
@@ -139,6 +121,25 @@ include_unplanned = true # include unplanned tasks in the report in an ad-hoc se
139
121
  additional_attributes_unplanned = ["due", "urgency"] # additional attributes to show in the report for unplanned tasks
140
122
  ```
141
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
+
142
143
  ## Tips and Tricks
143
144
 
144
145
  - You can exclude a task from being scheduled by removing the `time_map` or `estimated` attributes.
@@ -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,25 +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 simulates what happens if you work on a task for a certain time on a given day.
69
-
70
- For each day X starting from today, it sorts the tasks by decreasing urgency.
71
- It start from the most urgent tasks that can be allocated on day X depending on the task's
72
- `time_map` and on your calendars. It allocates a few number of hours to the task,
73
- then recomputes the urgencies exactly as Taskwarrior would do
74
- if it was running on day X. Having recomputed the urgencies, it restarts.
75
-
76
- If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
77
- task will get scheduled in its place.
78
-
79
- For `today`, taskcheck will consider as allocated the hours already past.
80
-
81
- The maximum time that is allocated at each attempt is by default 2 hours
82
- (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
83
66
 
84
67
  ## Configuration
85
68
 
@@ -126,6 +109,25 @@ include_unplanned = true # include unplanned tasks in the report in an ad-hoc se
126
109
  additional_attributes_unplanned = ["due", "urgency"] # additional attributes to show in the report for unplanned tasks
127
110
  ```
128
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
+
129
131
  ## Tips and Tricks
130
132
 
131
133
  - You can exclude a task from being scheduled by removing the `time_map` or `estimated` attributes.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "taskcheck"
3
- version = "0.3.3-2"
3
+ version = "0.4.0"
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 = []
@@ -20,6 +20,12 @@ arg_parser.add_argument(
20
20
  action="store",
21
21
  help="generate a report of the tasks based on the scheduling; can be any Taskwarrior datetime specification (e.g. today, tomorrow, eom, som, 1st, 2nd, etc.). It is considered as `by`, meaning that the report will be generated for all the days until the specified date and including it.",
22
22
  )
23
+ arg_parser.add_argument(
24
+ "-s",
25
+ "--schedule",
26
+ action="store_true",
27
+ help="perform the scheduling algorithm, giving a schedule and a scheduling UDA and alerting for not completable tasks",
28
+ )
23
29
 
24
30
  args = arg_parser.parse_args()
25
31
 
@@ -33,21 +39,27 @@ def load_config():
33
39
 
34
40
  def main():
35
41
  # Load data and check tasks
42
+ print_help = True
36
43
  if args.install:
37
44
  from taskcheck.install import install
38
45
 
39
46
  install()
40
47
  return
41
48
 
49
+ if args.schedule:
50
+ config = load_config()
51
+ check_tasks_parallel(config, verbose=args.verbose)
52
+ print_help = False
53
+
42
54
  if args.report:
43
55
  from taskcheck.report import generate_report
44
56
 
45
57
  config = load_config()
46
58
  generate_report(config, args.report, args.verbose)
47
- return
59
+ print_help = False
48
60
 
49
- config = load_config()
50
- check_tasks_parallel(config, verbose=args.verbose)
61
+ if print_help:
62
+ arg_parser.print_help()
51
63
 
52
64
 
53
65
  if __name__ == "__main__":
@@ -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",
@@ -315,7 +315,7 @@ def build_tasks_table(config, tasks):
315
315
  for task in tasks:
316
316
  task_id = f"[bold green]#{task['id']}[/bold green]"
317
317
  project = task.get("project", "")
318
- description = Text(task["description"], style="white")
318
+ description = Text(task["description"], style="italic")
319
319
  hours = f"[yellow]{task['scheduling_hours']}[/yellow]"
320
320
  emoji = get_task_emoji(config, task)
321
321
 
@@ -382,7 +382,7 @@ def build_unplanned_tasks_table(config, tasks):
382
382
  for task in tasks:
383
383
  task_id = f"[bold green]#{task['id']}[/bold green]"
384
384
  project = task.get("project", "")
385
- description = Text(task["description"], style="white")
385
+ description = Text(task["description"], style="italic")
386
386
  emoji = get_task_emoji(config, task)
387
387
 
388
388
  table.add_row(
@@ -1,10 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: taskcheck
3
- Version: 0.3.3.post2
3
+ Version: 0.4.0
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,25 +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 simulates what happens if you work on a task for a certain time on a given day.
82
-
83
- For each day X starting from today, it sorts the tasks by decreasing urgency.
84
- It start from the most urgent tasks that can be allocated on day X depending on the task's
85
- `time_map` and on your calendars. It allocates a few number of hours to the task,
86
- then recomputes the urgencies exactly as Taskwarrior would do
87
- if it was running on day X. Having recomputed the urgencies, it restarts.
88
-
89
- If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
90
- task will get scheduled in its place.
91
-
92
- For `today`, taskcheck will consider as allocated the hours already past.
93
-
94
- The maximum time that is allocated at each attempt is by default 2 hours
95
- (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
96
78
 
97
79
  ## Configuration
98
80
 
@@ -139,6 +121,25 @@ include_unplanned = true # include unplanned tasks in the report in an ad-hoc se
139
121
  additional_attributes_unplanned = ["due", "urgency"] # additional attributes to show in the report for unplanned tasks
140
122
  ```
141
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
+
142
143
  ## Tips and Tricks
143
144
 
144
145
  - You can exclude a task from being scheduled by removing the `time_map` or `estimated` attributes.
File without changes
File without changes