Skip to content

Instantly share code, notes, and snippets.

@Shinichi-Ohki
Last active July 10, 2019 08:41
Show Gist options
  • Save Shinichi-Ohki/df15b594e52f6a2f9ae61db1ef120151 to your computer and use it in GitHub Desktop.
Save Shinichi-Ohki/df15b594e52f6a2f9ae61db1ef120151 to your computer and use it in GitHub Desktop.
Todoistの特定のプロジェクト(Inbox)にあるタスクの締め切りを今日に、優先度を最高に変更する
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function,
absolute_import, unicode_literals)
from pytodoist import todoist
API_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
def main():
def list_asterisk():
return '* '
def expand_sub_task(indent):
return ' ' * indent
user = todoist.login_with_api_token(API_TOKEN)
project = user.get_project('Inbox')
print(list_asterisk() + project.name)
for task in project.get_tasks():
print(expand_sub_task(task.indent) +
list_asterisk() + str(task.id) + ' - ' + task.content + ' - ' + str(task.date_string) + ' - ' + str(task.priority))
task.priority = todoist.Priority.VERY_HIGH
task.date_string = 'today'
task.update()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment