caldav_tasks_api.utils package

Submodules

caldav_tasks_api.utils.data module

class caldav_tasks_api.utils.data.TaskData(attachments: 'list[str]' = <factory>, completed: 'bool' = False, changed_at: 'str' = '', created_at: 'str' = '', deleted: 'bool' = False, due_date: 'str' = '', list_uid: 'str' = '', description: 'str' = '', notified: 'bool' = False, parent: 'str' = '', percent_complete: 'int' = 0, priority: 'int' = 0, rrule: 'str' = '', start_date: 'str' = '', synced: 'bool' = False, tags: 'list[str]' = <factory>, summary: 'str' = '', trash: 'bool' = False, uid: 'str' = '', x_properties: 'XProperties' = <factory>, _api_reference: "Optional['TasksAPI']" = None)[source]

Bases: object

static from_ical(ical: str | bytes, list_uid: str) TaskData[source]

Build TaskData from a VTODO iCal string.

delete() bool[source]

Deletes this task from the server using the API reference.

Returns:

True if deletion was successful, False otherwise.

Raises:
  • RuntimeError – If no API reference is available.

  • PermissionError – If the API is in read-only mode.

  • ValueError – If the task list or task is not found.

to_dict() Dict[source]

Converts the TaskData instance to a dictionary.

to_ical() str[source]

Build VTODO iCal component string from TaskData properties.

attachments: list[str]
changed_at: str = ''
property child_tasks: list[TaskData]

Returns a list of child TaskData objects, if this task has children and an API reference to search for them. Searches for tasks whose ‘parent’ field matches this task’s UID.

completed: bool = False
created_at: str = ''
deleted: bool = False
description: str = ''
due_date: str = ''
list_uid: str = ''
notified: bool = False
parent: str = ''
property parent_task: TaskData | None

Returns the parent TaskData object, if this task has a parent UID and an API reference to search for it.

percent_complete: int = 0
priority: int = 0
rrule: str = ''
start_date: str = ''
summary: str = ''
synced: bool = False
tags: list[str]
trash: bool = False
uid: str = ''
x_properties: XProperties
class caldav_tasks_api.utils.data.TaskListData(color: 'str' = '', deleted: 'bool' = False, name: 'str' = '', synced: 'bool' = False, uid: 'str' = '', tasks: 'list[TaskData]' = <factory>)[source]

Bases: object

to_dict() Dict[source]

Converts the TaskListData instance to a dictionary.

color: str = ''
deleted: bool = False
name: str = ''
synced: bool = False
tasks: list[TaskData]
uid: str = ''
class caldav_tasks_api.utils.data.XProperties(initial_data: Dict[str, str] | None = None)[source]

Bases: object

A wrapper for X-properties dictionary to allow attribute-style access with normalized names, while preserving original keys.

get_raw_properties() Dict[str, str][source]

Returns the underlying dictionary of raw X-properties.

items()[source]

Allows iteration like a dictionary (e.g., for key, value in x_props.items()).

caldav_tasks_api.utils.logging_config module

Module contents