Skip to main content

Overview

Python wrapper for the Toodledo v3 API which is documented at http://api.toodledo.com/3/. Available on PyPI at https://pypi.org/project/toodledo/.

This fork is being actively maintained by Jonathan Kamens <jik@kamens.us>. Changelogs of new releases are published on Github.

Thanks to Rehan Khwaja for creating this library.

Please support this project on Patreon.

Usage

If you’re using this library to build a web app that will be used by multiple people, you need to be familiar with how to use OAuth2 for authentication between your web app and Toodledo. Explaining how to do that is beyond the scope of this document.

To use the library, you need to register an app in your Toodledo account. This can be done at https://api.toodledo.com/3/account/doc_register.php. You will need the client ID and client secret for your app shown on the registration page to connect to the API.

If you’re using this library to build a private script you’re running yourself, you will probably want to use the CommandLineAuthorization function in the library to authenticate the first time. Something like this:

import os
from toodledo import TokenStorageFile, CommandLineAuthorization

tokenFilePath = "fill in path to token file"
clientId = "fill in your app client ID"
clientSecret = "fill in your app client secret"
scope = "basic tasks notes folders write"
tokenStorage = TokenStorageFile(tokenFilePath)

if not os.path.exists(tokenFilePath):
    CommandLineAuthorization(clientId, clientSecret, scope, tokenStorage)

It will prompt you to visit a URL, which will prompt you to log into Toodledo if you’re not already logged in, then click a “SIGN IN” button. The sign in will fail since you presumably specified a bogus redirect URL when registering the app, but you can then copy the failed URL from your browser back into the script to complete the authentication process.

Once you’ve authenticated, you create an API instance like this:

toodledo = Toodledo(
  clientId=clientId,
  clientSecret=clientSecret,
  tokenStorage=tokenStorage,
  scope=scope)

And here’s how you call the API:

account = toodledo.GetAccount()

allTasks = toodledo.GetTasks()

See the help messages on individual methods.

See also this more extensive example of using the API in a script.

Using the task cache

In addition to close-to-the-metal access to the API endpoints, this library also implements a TaskCache class that you can use to cache tasks persistently in a file which is updated incrementally when things change in Toodledo. Import the class and look at its help string for more information.

Developing the library

The library uses poetry for managing packages, building, and publishing. You can do poetry install at the top level of the source tree to install all of the needed dependencies to build and run the library. poetry build builds packages, and poetry publish publishes them to PyPI.

All the code in the library is both pylint and flake8 clean, and any PRs that are submitted should maintain that. Run poetry run pylint *.py tests toodledo and poetry run flake8 to check everything.

To run the tests, set the following environment variables:

Then generate the credentials json file by running

poetry run python generate-credentials.py

Then run the tests by executing

poetry run pytest

in the root directory.

Please ensure that all the tests pass in any PRs you submit.

Release files for toodledo 1.5.1

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

Source distribution (sdist)

Source distribution for toodledo 1.5.1
File Size Uploaded
toodledo-1.5.1.tar.gz 17.3 kB Details

Built distribution (wheel)

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

Total release size: 37.4 kB

Release files / toodledo-1.5.1.tar.gz

Download URL toodledo-1.5.1.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
173aeb0cb2466627f67a1b2b3691c6e23b36ec51fa3166aa06e8c11e78a3773a
BLAKE2b-256 checksum
How to use checksums
561767496011320e34f4aa1165e762b0e07e20257ad0073936895a34b48b7402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.7 Linux/6.5.0-5-amd64

Release files / toodledo-1.5.1-py3-none-any.whl

Download URL toodledo-1.5.1-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a2e2fc2d9d773d166662b0e1d82c8185b6bb92fbed66d771e5e401ae9388aad
BLAKE2b-256 checksum
How to use checksums
961164e91e02c9575f3456ad861a752f8012d5f7799a51a5c16bb17036330d91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.7 Linux/6.5.0-5-amd64

Release history Release notifications | RSS feed

This release

1.5.1 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

2 release files

0.2

2 release files

0.1

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