tastic.tastic.document (class)

class tastic.tastic.document(filepath, parentObject=None)[source]

This is the taskpaper document object - top level object

Key Arguments:
  • filepath – path to the taskpaper document

Usage:

To read a taskpaper document, use something like this:

# READ IN A TASKPAPER FILE
from tastic.tastic import document
taskpaperFile = "path/to/saturday-tasks.taskpaper"
doc = document(taskpaperFile)

Note that tastic will tidy the contents of the file when it is read into memory. See the tidy() method for details.

__init__(filepath, parentObject=None)[source]

Methods

__init__(filepath[, parentObject])
add_note(note) Add a note to this taskpaper object
add_project(title[, tags]) Add a project to this taskpaper object
add_tag()
add_task(title[, tags]) Add a task to this taskpaper object
all_tasks() return a flat list of all tasks contained within this taskpaper object
del_tag(tag) delete a tag this taskpaper object
done()
get_project(projectName) recursively scan this taskpaper object to find a descendant project by name
get_task(taskName) recursively scan this taskpaper object to find a descendant task by name
notestr() return the notes of this object as a string
save([copypath]) save the content of the document back to the file
set_tags()
sort_projects(workflowTags) order the projects within this taskpaper object via a list of tags
sort_tasks(workflowTags[, indentLevel]) order tasks within this taskpaper object via a list of tags
tagged_projects(tag) return a list of projects contained within this taskpaper object filtered by a given tag
tagged_tasks(tag) return a list of tasks contained within this taskpaper object filtered by a given tag
tidy() Tidy this taskpapaer object so that sub-objects appear in this order: title, tags, notes, tasks, projects
to_string([indentLevel, title, tags, ...]) convert this taskpaper object to a string

Attributes

content The text content of this object (excluding title)
notes list of the notes assoicated with this object
parent This taskpaper object’s parent object (if any)
projects All child projects of this taskpaper object
raw_content The raw, untidied content of this taskpaper document
refresh Refreshs this documents’s attributesd
searches The search-block (if any) associated with this document
tags document objects have no tags
tasks list of the tasks assoicated with this object
title The title of this taskpaper object