Create a New Todoist Task from Python Script

Background

At work, we just began to use (or experiment with) Todoist to keep track of log files we need to collect from sites. Todoist is a task management tool that is available on mobile, desktop and web platforms.

Motivation

I wanted to see if I can manipulate the tasks from scripts. I'm using yowsuptodevelopaWhatsappbotsoIwaswonderingifIcansomehowgetthebottointeractwiththetasks(suchascreatenewtasks,markthemascomplete,etc). At a casual look, the script needs to use OAuth 2.0 token before it can interact with the tasks. Since I do not know anything about the OAuth 2.0 token, here's what I've done to get started.

Steps

Install pytodoist

pip install pytodoist

Get Google OAuth 2.0 Token

I don't know anything about OAuth 2.0 token. I definitely need to learn more about it later, but I found Google OAuth 2.0 Playground, where you can get a working token.

  1. Choose Google OAuth2 API v2
  2. Select https://www.googleapis.com/auth/userinfo.email and click Authorize APIs button
  3. Click Accept when Google OAuth 2.0 Playground requests to have offline access
  4. You will be given an authorization code. Click Exchange authorization code for tokens
  5. You will receive refresh and access tokens (If you do not see them, click Step 2 to reveal the tokens)
  6. Copy the access token

Login with Your OAuth 2.0 Token

from pytodoist import todoist
user = todoist.login_with_google('your-gmail-address', 'your-access-token')
print user.full_name
print user.is_logged_in()

Recommended Posts

Create a New Todoist Task from Python Script
Python script to create a JSON file from a CSV file
Create a new Python numerical calculation project
Create a deb file from a python package
Use Django from a local Python script
Edit Excel from Python to create a PivotTable
Create a C array from a Python> Excel sheet
"Python Kit" that calls a Python script from Swift
Create a decision tree from 0 with Python (1. Overview)
Create a new page in confluence with Python
Call a Python script from Embedded Python in C ++ / C ++
Create a datetime object from a string in Python (Python 3.3)
Create a Python environment
Run a python script from excel (using xlwings)
How to create a kubernetes pod from python code
Create a Wox plugin (Python)
Create a function in Python
Create a dictionary in Python
Run illustrator script from python
Create a python numpy array
Create a directory with python
How to use NUITKA-Utilities hinted-compilation to easily create an executable file from a Python script
How to run a Python program from within a shell script
[Python, shell script, team development] Create a nifty Git repository
Let's create a script that registers with Ideone.com in Python.
Python: Create a dictionary from a list of keys and values
Create a Python script for Wake on LAN (NAT traversal Wake on LAN [5])
Execute Python script from batch file
Call a Python function from p5.js.
Create a python GUI using tkinter
Create a DI Container in Python
Create a pandas Dataframe from a string.
Create a Python environment on Mac (2017/4)
Create new application use python, django
Create a virtual environment with Python!
Create a binary file in Python
python / Make a dict from a list.
Create a python environment on centos
Create a Python general-purpose decorator framework
Create a Kubernetes Operator in Python
5 Ways to Create a Python Chatbot
Launch a Python script as a service
Create a random string in Python
Write a batch script with Python3.5 ~
Create an instance of a predefined class from a string in Python
Create a shell script to run the python file multiple times
[Mac] Create a Python3 execution environment from the fully initialized state
How to create a clone from Github
[Cloudian # 3] Try to create a new object storage bucket with Python (boto3)
Create wordcloud from your tweet with python3
Execute a script from Jupyter to process
Create a dummy image with Python + PIL.
Create a python environment on your Mac
Send a message from Python to Slack
Let's create a virtual environment for Python
Create a tool to automatically furigana with html using Mecab from Python3
Create a JSON object mapper in Python
# 5 [python3] Extract characters from a character string
[Python] Create a Batch environment using AWS-CDK
Run the Python interpreter in a script
[Python] [LINE Bot] Create a parrot return LINE Bot