Skip to main content

todoist_tree

These are the core functions of todoist_bot.

The reading and writing functions are just (sometimes typeguarded) aliases of Todoist api calls. The differentiating functionality is building a tree with

import time
from todoist_tree import headers
from todoist_tree import read_changes
from todoist_tree import tree

headers = new_headers(api_token)
todoist = None
sync_token: str = "*"

complete = False

while not complete:

    todoist = read_changes.read_changes(headers)
    if todoist is None:
        # no changes or failure
        time.sleep(2)
        continue

    sync_token = todoist.sync_token

    projects = todoist.projects
    sections = todoist.sections
    tasks = todoist.tasks

    id2node = tree.map_id_to_branch(
        todoist.projects,
        todoist.sections,
        todoist.tasks
    )

    # do something here

    time.sleep(5)

The tree doesn't have one root. map_id_to_branch maps the id[1] of each project, section, and task to a node. Top-level projects will not have parents, so they are effectively roots of their own trees.

See todoist_bot for a full example.

[1] where id is the value returned in the json dictionary from the Todoist api, not the Python object id.

Metadata

Release files for todoist-tree 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for todoist-tree 0.5.2
File Size Uploaded
todoist_tree-0.5.2.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for todoist-tree 0.5.2
File Interpreter ABI Platform
todoist_tree-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.5 kB

Release files / todoist_tree-0.5.2.tar.gz

Download URL todoist_tree-0.5.2.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
602352ed19b860da8df5b2d0d8dc3e1309aa5ae3f7dd9522062216663aae618f
BLAKE2b-256 checksum
How to use checksums
c72fd319a30a1980a1b1508ab8a27ad3c534d9f0f64b51e57b248f0652183ae2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / todoist_tree-0.5.2-py3-none-any.whl

Download URL todoist_tree-0.5.2-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d42549beb560ec50b4005e9dfad36388322e66e3f6da4058cde410c0b15f81c
BLAKE2b-256 checksum
How to use checksums
109507b634ca162f29c159f27af1895898bfad4fe0d42cf05430578070e7dcde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.4.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page