magodo package

A Python library for working with the todo.txt format.

class MagicTodoMixin(todo)[source]

Bases: magodo._todo.TodoMixin, abc.ABC

Mixin class that implements the Todo protocol.

Parameters
classmethod cast_from_line_spells(line)[source]

Casts all from_line spells on line.

Parameters
Return type

str

cast_to_line_spells(line)[source]

Casts all to_line spells on line.

Parameters
Return type

str

classmethod cast_todo_spells(todo)[source]

Casts all spells associated with this MagicTodo on todo.

Parameters
  • cls (Type[TypeVar(M, bound= MagicTodoMixin)]) –

  • todo (TypeVar(T, bound= TodoProto)) –

Return type

EnchantedTodo[TypeVar(T, bound= TodoProto)]

property contexts
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

Tuple[str, ...]

property create_date
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

date

property desc
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

str

property done
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

bool

property done_date
Parameters

self (M) –

Return type

dt.date | None

property epics
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

Tuple[str, ...]

classmethod from_line(line)[source]

Converts a string into a MagicTodo object.

Parameters
Return type

Union[Ok[TypeVar(M, bound= MagicTodoMixin), ErisError], Err[TypeVar(M, bound= MagicTodoMixin), ErisError]]

from_line_spells = []
property metadata
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

Dict[str, str]

new(**kwargs)[source]

Creates a new Todo using the current Todo’s attrs as defaults.

Parameters
Return type

TypeVar(M, bound= MagicTodoMixin)

post_todo_spells = []
pre_todo_spells = []
property priority
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

Literal[‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’]

property projects
Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

Tuple[str, ...]

to_line()[source]

Converts this MagicTodo back to a string.

Parameters

self (TypeVar(M, bound= MagicTodoMixin)) –

Return type

str

to_line_spells = []
todo_spells = []
class Todo(desc, *, contexts=(), create_date=None, done_date=None, done=False, epics=(), metadata=None, priority='O', projects=())[source]

Bases: magodo._todo.TodoMixin

Represents a single task in a todo list.

Parameters
  • desc (str) –

  • contexts (Tuple[str, ...]) –

  • create_date (Optional[date]) –

  • done_date (Optional[date]) –

  • done (bool) –

  • epics (Tuple[str, ...]) –

  • metadata (Optional[Dict[str, str]]) –

  • priority (Literal[‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’]) –

  • projects (Tuple[str, ...]) –

classmethod from_line(line)[source]

Contructs a Todo object from a string (usually a line in a file).

Parameters

line (str) – The line to use to construct our new Todo object.

Return type

Union[Ok[Todo, ErisError], Err[Todo, ErisError]]

new(**kwargs)[source]

Creates a new Todo using the current Todo’s attrs as defaults.

Parameters

kwargs (Any) –

Return type

Todo

to_line()[source]

Converts this Todo object back to a line.

Return type

str

Submodules