Skip to main content

Official Python SDK for the Todoist REST API.

Project description

Todoist API Python Client

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

Installation

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

[tool.poetry.dependencies]
todoist-api-python = "^v2.0.0"

Supported Python Versions

Python 3.9 is fully supported and tested, and while it may work with other Python 3 versions, we do not test for them.

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 asynchronously
async def get_tasks_async():
    api = TodoistAPIAsync("YOURTOKEN")
    try:
        tasks = await api.get_tasks()
        print(tasks)
    except Exception as error:
        print(error)

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

Documentation

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

Development

To install Python dependencies:

$ poetry install

To install pre-commit:

$ poetry run pre-commit install

You can try your changes via REPL by running:

$ poetry run python

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

todoist_api_python-2.0.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

todoist_api_python-2.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file todoist_api_python-2.0.0.tar.gz.

File metadata

  • Download URL: todoist_api_python-2.0.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for todoist_api_python-2.0.0.tar.gz
Algorithm Hash digest
SHA256 040f6635f8602e4b38bc2a2de87c5bb44a567fcc230872b2e844e921dea7a60b
MD5 f9a0c26fbed5f3701c2297bcb56e2a6a
BLAKE2b-256 c38e63c7c32f80790b70cb79435ea3bee36d09a1bb5ebfdbdb5b2f76a90ec721

See more details on using hashes here.

File details

Details for the file todoist_api_python-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for todoist_api_python-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a33fb67d88edc706cf7eddf751684c323bbd8f7548aa528cdc26a86e00e526
MD5 d15b83c10ebd0e3f114f500686bc81de
BLAKE2b-256 6b707d00aee1226d66f3cf4e8c082ae61c6ff2abaae087afc1ed8a9fb8b542aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page