Every hour my Todoist labels are automatically sorted. Every four hours, I sort some projects according to my preference. Here is a video example of each:
You can find all my code and supporting files for this on my Github page.
- A CloudWatch event rule triggers a Step Function hourly.
- The Step Function triggers a Lamda execution which enumerates Todoist labels via a GET request to the Todoist REST endpoint.
- The labels are bubble sorted.
- A POST call to the Todoist endpoint with the desired label ordering completes the Lambda execution.
- A CloudWatch event rule triggers a Step Function every four hours.
- The Step Function triggers a Lamda execution which utilises a Lambda layer consisting of the official Python library for Todoist.
- The Lambda function is provided static JSON input which describes the sorting intention for each project.
- A Sync with Todoist is called to get the current task information.
- Each project has its tasks bubble sorted by the described intention and another sync with Todoist is performed.
- Labels are assumed to be unordered each execution. As such, there may be superfluous calls to the API if the labels are already in order.
- The sort rules are static.
In order of preference:
- Provide a UI for modifying or creating new sort rules.
- Migrate the label sorting into the Sync API.
- Review the assumption that the labels are always out of order.