magenda.py is a Python 3 script for creating an agenda of task-list items in
GitHub Flavored Markdown files.
Task-list items are
list items with one of the task-list item markers
the list marker.
This script recognises various metadata in the first line of a task-list item. For this line, the following general format is assumed:
<indentation>? <list marker> <task-list item marker> <title> <mention>* <hashtag>* <date-tag>?
- [ ] buy presents: #shopping - [ ] buy Christmas presents @NN #christmas #due:2020-12-24
@NN is a mention,
#shopping are hashtags, and the
#due:2020-12-24 is a due-date specification. Indented
task-list items like the second one are taken to be subtasks.
The script is released 'as is' with no warranty under the GNU General Public License, version 2.0.
It requires the following Python 3 package:
On Debian-based systems, the prerequisite can be installed as follows:
sudo apt-get install python3-blessings
magenda.py [-c] [--completed-tasks] [-C] [--force-color] [-d <num>] [--days <num>] [-n] [--line-number] [-r] [--reversed] [-s] [--subtasks] [-u] [--undated-tasks] <Markdown file(s)> magenda.py [-v] [--version] magenda.py [-h] [--help]
Running the script with
-u options on a Markdown
the task-list items above will generate the following output:
Thu 24 Dec file.md:buy Christmas presents @NN #christmas Undated file.md:buy presents #shopping
Given these options, subtasks and undated tasks are considered in addition to
dated tasks. In order to restrict the date range, use the
-d option with the
number of days from today as an argument. The
-r option reverses the date
order. Line numbers can be output in addition to file names by means of the
By default, only uncompleted tasks (i.e. task-list items with the task-list item
[ ]) are taken into account. With the
-c option, completed tasks
(task-list items with the task-list item markers
[X]) are listed
instead; in this case, dates are determined on the basis of date-tags like
In a terminal, the output is pretty-printed. The
-C option preserves colors
and formatting codes when piping the output through
GNU less or similar programs.
Andreas Nolda (firstname.lastname@example.org)