Skip to content

Doist/todoist-api-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b81d945 · May 1, 2025
Apr 24, 2025
Apr 15, 2025
Apr 30, 2025
Apr 30, 2025
Apr 15, 2025
Mar 31, 2025
Apr 15, 2025
May 1, 2025
Jan 26, 2021
Apr 24, 2025
Nov 19, 2021
Apr 11, 2025
Apr 24, 2025
Apr 24, 2025
Apr 24, 2025

Repository files navigation

Todoist API Python Client

This is the official Python SDK for the Todoist API.

Installation

pip install todoist-api-python

Or add the project as a dependency in pyproject.toml:

dependencies = [
  "todoist-api-python>=3.0.1,<4",
]

Supported Python Versions

Python version 3.9 and above.

Usage

Here's an example of initializing the API client, fetching a task, and paginating through its comments:

from todoist_api_python.api import TodoistAPI

api = TodoistAPI("YOUR_API_TOKEN")

task = api.get_task("6X4Vw2Hfmg73Q2XR")
print(f"Task: {task.content}")

comments_iter = api.get_comments(task_id=task.id)
for comments in comments_iter:
    for comment in comments:
        print(f"Comment: {comment.content}")

Documentation

For more detailed reference documentation, have a look at the SDK documentation and the API documentation.

Development

To install Python dependencies:

$ uv sync

To install pre-commit:

$ uv run pre-commit install

You can try your changes via REPL by running:

$ uv run python

You can then import the library as described in Usage without having to create a file. If you decide to use TodoistAPIAsync, please keep in mind that you have to import asyncio and run asyncio.run(yourmethod()) to make your async methods run as expected.

Releases

This API client is public, and available in a PyPI repository.

A new update is automatically released by GitHub Actions, by creating a release with a tag in the format vX.Y.Z (v<Major>.<Minor>.<Patch>).

Users of the API client can then update to the new version in their pyproject.toml file.

Feedback

Any feedback, bugs, questions, comments, etc., can be reported as Issues in this repository.

Contributions

We would love contributions! Pull requests are welcome.