使用 todoist python api 添加周期性任务

using todoist python api to add a recurring task

我正在尝试使用 python api.

添加一个循环任务到 todoist

我在下面尝试过,但不知道如何指定重复设置

from pytodoist import todoist
user = todoist.login('login', 'pass')
project = user.get_project('my_project')
task = project.add_task('My Recuring task')
task = project.add_task('My Recuring task tomorrow at 2 pm')

我推荐你使用我们的主库。

这是每天创建一个新任务的单行代码:

python2.7 -c "import todoist; import os; token = os.environ.get('token'); api = todoist.TodoistAPI(token); api.items.add('test', None, date_string='ev day'); api.commit()"

分解:

# import the library
import todoist

# retrieve the token from my environment variables
import os
token = os.environ.get('token'); 

# initialize the API object
api = todoist.TodoistAPI(token)

# Create a new task called "test", with "None" as the project id and date_string as kwargs for the arguments of the item.
api.items.add('test', None, date_string='ev day')

# commit it! :)
api.commit()"

在最后一个参数中你可以传递所有参数available in the documentation as command arguments