Compare commits

...

54 Commits
v1.1 ... master

Author SHA1 Message Date
earnest ma 9949984269
Add systemd service file 2022-05-19 21:25:26 -04:00
earnest ma 13eb8ad46a
Add script to run 2022-05-19 15:02:43 -04:00
Hoffelhas 67935a5b0c
Update README.md 2021-08-24 14:53:59 +02:00
Hoffelhas 5f3fef0e8f
Update README.md 2021-01-25 19:50:42 +01:00
Hoffelhas 50c126b332
Update README.md 2021-01-25 19:49:24 +01:00
Hoffelhas 11f9830fea
Update README.md 2021-01-25 19:48:45 +01:00
Hoffelhas 0215af31fd
Update README.md 2021-01-25 18:27:07 +01:00
Hoffelhas a38f14e40c
Update README.md 2021-01-25 18:25:28 +01:00
Hoffelhas 319171251f
Update README.md 2021-01-25 18:21:50 +01:00
Hoffelhas c7ab4e564c v1.5 2021-01-25 18:00:43 +01:00
Hoffelhas d129885bbc setup.py update 2021-01-23 21:53:17 +01:00
Hoffelhas 097ea0caae Updated todoist-python to version 8.1.3 and added requests 2.25.1 2021-01-23 21:48:19 +01:00
Hoffelhas 4c421b7577 Fixed bug with incorrect label recognition. Added new debug logging lines, and removed redundant ones 2021-01-23 21:29:06 +01:00
Hoffelhas a4ac562068 Made -r tag backwards compatible with v1.4 2021-01-17 15:14:33 +01:00
Hoffelhas bd9e5d021b Fixed a view bugs for the new regeneration mode, plus some additional clean-up of code. In addition fixed a labelling bug on deeper levels, and headered items will be cleaned of old next-action labels. 2021-01-17 14:58:14 +01:00
Hoffelhas f97c7e70e0 Implemented new structure for regeneration mode. New modes have been added, and specific modes can be assigned to tasks by use of labels. 2021-01-16 22:42:46 +01:00
Hoffelhas 376e176d6b General clean-up of code 2021-01-16 17:14:22 +01:00
Hoffelhas 17cc3a8418 Wrong warning message was given for a different kind of wrong syntax; additional warning added. 2021-01-16 15:54:21 +01:00
Hoffelhas 16d404a9ed Fixed bug which caused a wrong read of the start=DATE string 2020-12-31 16:02:58 +01:00
Hoffelhas 22fab54dfc
Update README.md 2020-12-30 14:22:33 +01:00
Hoffelhas d1f6ac802c
Update README.md 2020-12-30 14:12:56 +01:00
Hoffelhas ea20ad2aa1 Clean-up for v1.4 2020-12-30 13:46:20 +01:00
Hoffelhas ecbe8a28fa Added logic to header or unheader multiple items, specifiec from project, section, or top item level 2020-12-30 13:21:16 +01:00
Hoffelhas 346702b904 Debug header_items 2020-12-30 01:32:17 +01:00
Hoffelhas 3e14d69653 Added possibility to define start-date as an offset from due-date. 2020-12-30 00:35:07 +01:00
Hoffelhas 41c3cc3b5c Tested new section logic. In addition 'delay' has been optimised by taking computation time into account. General clean-up of code 2020-12-29 22:56:55 +01:00
Hoffelhas c50f62d946 Sections refactoring completed. Next up, code-cleanup and testing 2020-12-28 23:18:54 +01:00
Hoffelhas 3943c5c614 Pseudocode updated, section loop build-in, still need to build a class to handle 'no section' tasks, and finalize labeling logic 2020-12-17 21:02:30 +01:00
Hoffelhas a913c74086 Decided to add a separate section loop to allow for a better flow of the logic. Initial start made, still needs to be fleshed out. 2020-12-16 22:05:27 +01:00
Hoffelhas 6d3439019c Continued work on section labelling 2020-12-07 22:45:12 +01:00
Hoffelhas c1b14f55ac Added section type functionality. Still needs incorporation with label logic 2020-12-07 17:44:12 +01:00
Hoffelhas 70567cacf5 Initial modifications to include section type 2020-12-06 23:08:47 +01:00
Hoffelhas 0d18c8c8b6
Update README.md 2020-09-25 13:59:54 +02:00
Hoffelhas f3bd20cf8c
Update README.md 2020-06-15 19:01:23 +02:00
Hoffelhas 4f7981aee8
Update README.md 2020-06-13 18:55:14 +02:00
Hoffelhas 21d80334ee
Update README.md 2020-06-13 18:41:47 +02:00
Hoffelhas bc7f6938b6
Update README.md 2020-06-13 18:39:24 +02:00
Hoffelhas b6466130f4
Update README.md 2020-06-13 18:37:39 +02:00
Hoffelhas 7bd8b5a91a
Update README.md 2020-06-13 18:36:37 +02:00
Hoffelhas 4f531dd0dc
Update README.md 2020-06-13 18:27:15 +02:00
Hoffelhas 55e0153677 Testing start-date and hide-future concluded 2020-06-13 17:45:08 +02:00
Hoffelhas 9645942c5c 1) Hide-future date has been fixed 2) start-date functionality added 2020-06-13 15:26:56 +02:00
Hoffelhas 82b8bd2385 Implemented first iteration of asynchronous labelling of proejct/parentless tasks and sub-tasks 2020-06-13 11:13:03 +02:00
Hoffelhas 50830eaaa8 Prompt if user wants to create an undefined label, instead of auto-creating 2020-06-07 16:20:55 +02:00
Hoffelhas fa3d7fa1dd If the given label doesn't exists, a new one is now automatically created! 2020-06-07 15:18:12 +02:00
Hoffelhas b2430dcb1e Added modes check and CLI output as additional feedback during initialising 2020-06-07 14:59:47 +02:00
Hoffelhas 9c947b7292
Update README.md 2020-05-30 15:34:19 +02:00
Hoffelhas 3d8fb97c93
Update README.md 2020-05-30 14:46:19 +02:00
Hoffelhas ff31adc65b Put second sync back in, for some reason this makes it much more stable.
Final testing concluded, pushing for release.
2020-05-30 13:49:37 +02:00
Hoffelhas a552954d8b Bug has magically gone away on Todoist's end. For now moving on.
Parser lay-out, help content, and arguments have been improved.
2020-05-30 13:14:07 +02:00
Hoffelhas c4792b9a17 Strange bug found when testing the modulised lay-out.
Tasks that have been given an old_date show unexplained behaviour.
If set on today and recurring every day, checking it will move it TWO days.
2020-05-30 12:29:25 +02:00
Hoffelhas 4690b68245 Finalised test of alternative end-of-day time 2020-05-30 10:19:45 +02:00
Hoffelhas f51d7cb46a Implemented the functionality for an alternative end-of-day time. 2020-05-29 22:11:27 +02:00
Hoffelhas 011e100173 Quick and dirty test for an alternative end-of-day time when checking a daily recurring task. 2020-05-28 21:51:20 +02:00
6 changed files with 1073 additions and 390 deletions

126
README.md
View File

@ -1,9 +1,13 @@
# Autodoist
This program adds two major functionalities to Todoist to help automate your workflow:
This program adds four major functionalities to Todoist to help automate your workflow:
1) Assign automatic `@next_action` labels for a more GTD-like workflow
2) Enable re-use of subtasks in lists with a recurring date
1) Assign automatic next-action labels for a more GTD-like workflow
- Flexible options to label tasks sequentially or in parallel
- Limit labels based on a start-date or hide future tasks based on the due date
2) Enable regeneration of sub-tasks in lists with a recurring date. Multiple modes possile.
3) Postpone the end-of-day time to after midnight to finish your daily recurring tasks
4) Make multiple items (un)checkable at the same time
If this tool helped you out, I would really appreciate your support by providing me with some coffee!
@ -13,44 +17,98 @@ If this tool helped you out, I would really appreciate your support by providing
# Requirements
* Python 3.8
* ```todoist-python``` package.
Autodoist has been build with Python 3.9.1, which is the recommended version. Older versions of 3.x should be compatible, however be aware that they have not been tested.
# Automatic next action labels
To run Autodoist the following packages are required:
* ```todoist-python```
* ```requests```
The program looks for pre-defined tags in the name of every project and parentless tasks in your Todoist account to automatically add and remove `@next_action` labels.
For your convenience a requirements.txt is provided, which allows you to install them by using pip:
Projects and parentless tasks can be tagged independently from each other to create the required functionality. If this tag is not defined, it will not activate this functionality. The result will be a clear, current and comprehensive list of next actions without the need for further thought.
`pip install -r requirements.txt`
Make sure the label ```next_action``` exists in your Todoist before running the program. The default label can be changed, see the example given at [additional arguments](#additional-arguments). Todoist Premium is required in order to use labels and to make this functionality possible.
# 1. Automatic next action labels
## Sequential list processing
The program looks for pre-defined tags in the name of every project, section, or parentless tasks in your Todoist account to automatically add and remove `@next_action` labels. To create a simple list of all your next actions you can add a new filter in your Todoist with e.g.: @next_action & #project_name.
If a project or parentless task ends with `--`, the sub-tasks will be treated as a priority queue and the most important will be labeled `@next_action`. Importance is determined by order in the list.
Projects, sections, and parentless tasks can be tagged independently from each other to create the required functionality. If this tag is not defined, it will not activate this functionality. The result will be a clear, current and comprehensive list of next actions without the need for further thought.
See the example given at [running Autodoist](#running-autodoist) on how to run this mode. If the label does not exist yet in your Todoist, a possibility is given to automatically create it. Todoist Premium is required in order to use labels and to make this functionality possible.
## Useful filter tip
For a more GTD-like workflow, you can use Todoist filters to create a clean and cohesive list that only contains your actionable tasks. As a simple example you could use the following filter:
`@next_action & #PROJECT_NAME`
## Sequential processing
If a project, section, or parentless task ends with `--`, both the parentless tasks and its sub-tasks will be treated as a priority queue and the most important will be labeled. Importance is determined by order in the list.
![Serial task](https://i.imgur.com/SUkhPiE.gif)
## Parallel list processing
## Parallel processing
If a project or parentless task name ends with `//`, the sub-tasks will be treated as parallel `@next_action`s.
A waterfall processing is applied, where the lowest possible sub-tasks are labelled.
If a project, section, or parentless task name ends with `//`, both the parentless tasks and its sub-tasks will be treated as parallel. A waterfall processing is applied, where the lowest possible sub-tasks are labelled.
![Parallel task](https://i.imgur.com/NPTLQ8B.gif)
## Parentless tasks
## Advanced labelling
Any parentless task can be be given a type by appending `//` or `--` to the name of the task. This works if there is no project type, and will override a previously defined project type.
If a project or section ends with `-/`, all parentless tasks are processed sequentially, and its sub-tasks in parallel.
[See example](https://i.imgur.com/uGJFeXB.gif)
If a project or section ends with `/-`, all parentless tasks are processed in parallel, and its sub-tasks sequentially.
[See example](https://i.imgur.com/5lZ1BVI.gif)
Any parentless task can also be be given a type by appending `//` or `--` to the name of the task. This works if there is no project type, and will override a previously defined project type.
[See example 1 with a parallel project](https://i.imgur.com/d9Qfq0v.gif)
[See example 2 with a serial project](https://i.imgur.com/JfaAOzZ.gif)
# Recurring lists
Note: Todoist sections don't like to have a slash in the name, it will automatically change to an underscore. The default label options will recognize this to make it work regardless. Of course you're always free to define your own custom label symbols.
The program looks for all parentless tasks with a recurring date. If they contain sub-tasks, they will be restored in the same order when the parentless task is checked. Todoist Premium is not required for this functionality.
## Start/Due date enhanced experience
Two methods are provided to hide tasks that are not relevant yet.
- Prevent labels by defining a start-date that is added to the task itself. The label is only assigned if this date is reached. You can define the start-date by adding 'start=DD-MM-YYYY'. On the other hand the start date can be defined as several days or weeks before the due-date by using either 'start=due-<NUMBER_OF_DAYS>d' or 'start=due-<NUMBER_OF_WEEKS>w'. This is especially useful for recurring tasks!
[See an example of using start-dates](https://i.imgur.com/WJRoJzW.png).
- Prevent labels of all tasks if the due date is too far in the future. Define the amount by running with the argument '-hf <NUMBER_OF_DAYS>'.
[See an example of the hide-future functionality](https://i.imgur.com/LzSoRUm.png).
# 2. Regenerate sub-tasks in recurring lists
The program looks for all parentless tasks with a recurring date. If they contain sub-tasks, they will be regenerated in the same order when the parentless task is checked. Todoist Premium is not required for this functionality.
![See example](https://i.imgur.com/WKKd14o.gif)
To give you more flexibility, multiple modes are provided:
1. No regeneration
2. Checking the main task regenerates all sub-tasks
3. Checking the main task regenerates all sub-tasks only if all sub-tasks have been checked first
When this functionality is activated, it is possible to chose which mode is used as overall functionality for your Todoist. See the example given at [running Autodoist](#running-autodoist).
In addition you can override the overall mode by adding the labels `Regen_off`, `Regen_all`, or `Regen_all_if_completed` to one of your main recurrings task. These labels will automatically be created for you.
# 3. Postpone the end-of-day
You have a daily recurring task, but you're up working late and now it's past midnight. When this happens Todoist will automatically mark it overdue, and when checked by you it moves to tomorrow. This means that after a good nights rest you can't complete the task that day!
By setting an alternative time for the end-of-day you can now finish your work after midnight and the new date will automatically be corrected for you. Todoist Premium is not required for this functionality.
![See example 1](https://i.imgur.com/tvnTMOJ.gif)
# 4. Make multiple items uncheckable / re-checkable at the same time
Todoist allows the asterisk symbol `* ` to be used to ensure tasks can't be checked by turning them into headers. Now you are able to do this en masse!
Simply add `** ` or `!* ` in front of a project, section, or top item, to automatically turn all the items that it includes into respectively headers or checkable tasks. Note: when used in a project title or section title, Todoist will replace an exclamation mark with an underscore; this functionality should nevertheless still work.
# Executing Autodoist
@ -58,29 +116,37 @@ You can run Autodoist from any system that supports Python.
## Running Autodoist
Autodoist will read your environment to retrieve your Todoist API key, so to run on Windows/Linux/Mac OSX you can use the following commandline:
python autodoist.py -a <API Key>
Autodoist will read your environment to retrieve your Todoist API key and additional arguments. In order to run on Windows/Linux/Mac OSX you can use the following command lines.
If you want to enable recurring re-use mode, run with the `-r` argument:
If you want to enable labelling mode, run with the `-l` argument:
python autodoist.py -a <API Key> -r
python autodoist.py -a <API Key> -l <LABEL_NAME>
If you want to enable regeneration of sub-tasks in recurring lists, run with the `-r` argument followed by a mode number for the overall functionality (1: no regeneration, 2: regenerate all, 3: regenerate ony if all sub-tasks are completed):
python autodoist.py -a <API Key> -r <NUMBER>
If you want to enable an alternative end-of-day, run with the `-e` argument and a number from 1 to 24 to specify which hour:
python autodoist.py -a <API Key> -e <NUMBER>
These modes can be run individually, or combined with each other.
## Additional arguments
Several arguments can be provided, for example to change the default label:
Several additional arguments can be provided, for example to change the suffix tags for parallel and sequential projects:
python autodoist.py -l <label>
python autodoist.py --pp_suffix <tag>
python autodoist.py --ss_suffix <tag>
Or if you want to hide all tasks due in the future:
Or to change the suffix tags:
python autodoist.py --parallel_suffix <tag>
python autodoist.py --serial_suffix <tag>
python autodoist.py --hf <NUMBER_OF_DAYS>
In addition, if you experience issues with syncing you can increase the api syncing time (default 5 seconds):
python autodoist.py --delay <time in seconds>
For all arguments check help:
For all arguments, please check out the help:
python autodoist.py --help

File diff suppressed because it is too large Load Diff

17
autodoist.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description=Autodoist
After=syslog.target
After=network.target
[Service]
RestartSec=5s
Type=simple
User=earne
Group=earne
WorkingDirectory=/home/earne/autodoist
ExecStart=/home/earne/autodoist/run.sh
Restart=always
# Environment=
[Install]
WantedBy=multi-user.target

View File

@ -1 +1,2 @@
todoist-python>=8.1.1
requests>=2.25.1
todoist_python>=8.1.3

14
run.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
if [ ! -d venv ]; then
echo "Creating virtualenv and installing requirements"
python3 -m venv venv
venv/bin/pip3 install -r requirements.txt
fi
venv/bin/python3 autodoist.py \
-a $(cat .api-token) \
-l Next \
-r 2 \
-e 1 \
--delay 7

View File

@ -2,14 +2,15 @@ from setuptools import setup
setup(
name='autodoist',
version='1.0',
version='1.5',
py_modules=['autodoist'],
url='https://github.com/Hoffelhas/automation-todoist',
license='MIT',
author='Alexander Haselhoff',
author_email='alexander.haselhoff@outlook.com',
description='Added functionality for Todoist: 1) next-action labels and 2) re-use recurring sub-tasks',
description='Added functionality for Todoist: 1) next-action labels, 2) sub-task regeneration, 3) postpone end of day, and 4) (un)header items simultaneously)',
install_requires=[
'todoist-python',
'requests',
]
)