Skip to main content

Schedules Todos into your Calendar

Project description

Melon Task Scheduler + UI

A CalDav Todo-List (/ Task-Scheduling) Application that uses Markov chain Monte-Carlo to optimise a task schedule. It also features a User Interface written with Qt6.

To start the GUI:

from melongui.main import main
main() # to start the GUI

which launches a User Interface such as the one depicted in Figure 1. To load todos from a remote calendar, as specified in the configuration file, and schedule them, use the following code-snippet:

from melon.melon import Melon
from melon.scheduler.rust import RustyMCMCScheduler
melon = Melon()
melon.autoInit()
melon.scheduleAllAndExport("task-schedule.ics", Scheduler=RustyMCMCScheduler)

Creation of and interaction with \texttt{Todo}s in the calendar can be simple:

from melon.melon import Melon

melon = Melon()  # loads the config and initialises
melon.autoInit()  # initiates a network connection to the server
matches = list(melon.findTask("Submit report"))
matches[0].complete()  # marks the todo as complete and syncs

calendar = melon.calendars["My Calendar"]
calendar.sync()  # fetches updates from the server
todo = calendar.createTodo("New Todo")
todo.dueDate = datetime.date.today()
todo.save()  # saves the todo to the server

In order to run the scheduler on demonstration data, please run

from melon.scheduler.rust import RustyMCMCScheduler
tasks = generateManyDemoTasks(N=80)
scheduler = RustyMCMCScheduler(tasks)
result = scheduler.schedule()

If not specified in the initialiser, Melon loads a configuration file located in the user’s home configuration directory, so on Linux ~/.config/melon/config.toml. The file uses Tom’s Obvious, Minimal Language (TOML) format and has the following contents:

[client]
url = "https://my-caldav-server.org:2023/dav/user/calendars/"
username = "user"
password = "password"

Melon is a Python package on a Markov chain Monte-Carlo (MCMC), using Metropolis-Hastings with Simulated Annealing, optimisation of task scheduling. The idea would be to automatically schedule a set of tasks into a calendar based on due date, duration estimate (perhaps dynamically updated), task priority, associated project affiliation and most importantly, location. State permutations would be generated randomly according to a probability distribution, starting from a good initial guess of ordering tasks by due date and priority.

One can then define multiple optimisation metrics, based on the number of performed tasks weighted by priority and the need to switch locations. So in some sense, reducing the need for commute to e.g. work and scheduling hybrid / on-site tasks according to that (resembling the travelling-salesman problem). One could also make that very context dependent using project affiliations or certain keywords, automating the process. All of this should be done keeping the due date in mind. Another challenge is to encode task dependencies i.e. task B requiring the completion of task A beforehand.

Coding-wise this will include the algorithm itself, appropriate configuration and furthermore, I would like to integrate the system with a CalDAV endpoint for use with my personal calendar, making it accessible through a GUI (separated from the Python interface, so that one would be able to run the algorithm without). Of course there will be tests and documentation on how to set things up, use the library on its own and how to install the GUI application. An extension would be for the scheduler to learn about task properties based on user behaviour when rescheduling, etc. (detecting procrastination of an important task) and perhaps optimising suggestions based on that.

As performance might become an issue for MCMC, we will attempt the use of low-level languages such as C++ in combination with tools such as pybind11, to outsource short performance-critical code sections away from Python to another language?

The task check icon is the logo of the \textit{Tasks.org} Free and Open Source Android App, which may be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

melon_scheduler-0.2.0.tar.gz (1.1 MB view hashes)

Uploaded Source

Built Distribution

melon_scheduler-0.2.0-py3-none-any.whl (1.1 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page