Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 4.0.1 instead.
Reason given by maintainers: Build is broken, package is missing

Todoist API Python Client

This is the official Python API client for the Todoist REST API.

Installation

The repository can be included as a dependency in pyproject.toml. It is best to integrate to a release tag to ensure a stable dependency:

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

Supported Python Versions

While we only actively test under Python 3.13, we strive to support all versions from Python 3.9 and above.

Usage

An example of initializing the API client and fetching a user's tasks:

from todoist_api_python.api_async import TodoistAPIAsync
from todoist_api_python.api import TodoistAPI

# Fetch tasks synchronously
def get_tasks_sync():
    api = TodoistAPI("my token")
    try:
        tasks = api.get_tasks()
        print(tasks)
    except Exception as error:
        print(error)

# Fetch tasks asynchronously
async def get_tasks_async():
    api = TodoistAPIAsync("YOURTOKEN")
    try:
        tasks = await api.get_tasks()
        print(tasks)
    except Exception as error:
        print(error)

Example of paginating through a completed project tasks:

def get_all_completed_items(original_params: dict):
    params = original_params.copy()
    results = []

    while True:
        response = api.get_completed_items(**(params | {"limit": 100}))
        results.append(response.items)

        if not response.has_more:
            break

        params["cursor"] = response.next_cursor

    # flatten the results
    return [item for sublist in results for item in sublist]

items = get_all_completed_items({"project_id": 123})

Documentation

For more detailed reference documentation, have a look at the API documentation with Python examples.

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, such as bugs, questions, comments, etc. can be reported as Issues in this repository, and will be handled by Doist.

Contributions

We would love contributions in the form of Pull requests in this repository.

Metadata

Release files for todoist_api_python 3.0.0

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_api_python 3.0.0
File Size Uploaded Provenance Actions
todoist_api_python-3.0.0.tar.gz 4.0 kB Without provenance Details for todoist_api_python-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for todoist_api_python 3.0.0
File Interpreter ABI Platform Actions
todoist_api_python-3.0.0-py3-none-any.whl Python 3 none any Details for todoist_api_python-3.0.0-py3-none-any.whl

Total release size: 8.0 kB

Release files / todoist_api_python-3.0.0.tar.gz

Download URL todoist_api_python-3.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
88a3416910edd95ba71338d94cddf6a288c15a7298f9faff39def7d7f3ca29f3
BLAKE2b-256 checksum
How to use checksums
ec24f59fe983fac67cfa96a0690e2a7bf735aa2a9b076e762964d315ffc0869b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Release files / todoist_api_python-3.0.0-py3-none-any.whl

Download URL todoist_api_python-3.0.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2db2e11a4df1dc7b11c9b95b142f1815b3c910f7ee07b469202966b07c1c141
BLAKE2b-256 checksum
How to use checksums
9f1a6fb450e6e102d380aab673da6f181916071b5a79d2329650fb51d64b6d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Security for todoist_api_python 3.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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