Code Monkey home page Code Monkey logo

todoist-api-python's Introduction

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 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.

todoist-api-python's People

Contributors

davidfishlock avatar dependabot[bot] avatar lefcha avatar renovate[bot] avatar jankratochvilcz avatar proxi avatar goncalossilva avatar jkawamoto avatar renovate-bot avatar pothix avatar sadikkuzu avatar rwp0 avatar cdce8p avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.