适用于 Todoist 的 Actionista Action CLI。从命令行以批量方式添加、选择、打印、重新安排、修改和完成任务。
项目描述
Actionista Action-Chain CLI for Todoist (actionista-todoist)
适用于 Todoist 的 Actionista Action CLI。
从命令行管理您的 Todoist 任务,使用强大的过滤器以批量方式选择、打印、重新安排和完成任务。
您的议程上是否有数十甚至数百个逾期任务?使用 Todoist 的 Actionista Action CLI 在几秒钟内清理您的任务列表。您现在可以放心地休息一天。
Todoist ( todoist-action-cli) 的此 Action CLI 对任务列表按顺序运行。您从所有任务的列表开始,然后使用可用的众多过滤器之一选择任务。然后,您可以对选定的任务进行排序、打印和重新安排。
Actionista Action-Chain CLI for Todoist (actionista-todoist) 的灵感来自强大的find命令行工具。它采用“操作链”方法find来查找和选择硬盘上的文件,并将其应用于管理您的 Todoist 任务列表。
成功的find实用程序通过提供一系列“动作”(在find手册中也称为“表达式”)来工作。
大多数操作本质上是过滤器,您可以在其中列出要查找的文件的条件。然而,真正的可用性find在于它不仅可以打印匹配的文件,还可以将匹配的文件用于其他操作,例如删除文件,或将它们发送到其他命令行工具。
actionista动作链 CLI 采用了类似的方法。从完整的任务列表开始,您可以应用过滤器来准确找到您需要的那些任务。与其他操作一起,您可以print、reschedule、rename、mark-complete或delete
任何您需要的任务。您可以按任何顺序调用任意数量的操作,包括过滤器和其他操作。操作完全按照您指定的顺序调用。
因此,如果您愿意,您可以按项目名称过滤任务,打印给定项目中的所有任务,然后按截止日期过滤,再次打印,然后重新安排刚刚打印的任务,然后按确切名称过滤,然后标记该(或那些)剩余任务已完成,并最终将更改提交到服务器。这个例子主要是为了展示什么是可能的,我个人不建议有这么复杂的动作列表,但你基本上可以自由地列出你想要或需要的尽可能多(或尽可能少)的动作。作为记录,执行所描述的一系列操作看起来像这样:
$ todoist-action-cli -project Wedding -print \
-due before today \
-print \
-reschedule tomorrow \
-name startswith "Pick up the rings" \
-rename "Remind Tommy to pick up the rings" \
-commit
通常,为了您自己的理智,命令行的使用会更简单一些,并且每次调用只有一个“目的”:
# Basic example: Find tasks containing the string "rings":
$ todoist-action-cli -sync -name "*rings*" -sort -print
通用的命令行用法是:
$ todoist-action-cli [-action [args]] [-action [args]] [...]
您还可以从 python 导入包:
>>> import actionista.todoist
>>> import actionista.todoist.action_cli
注意:这个包以前被导入为rsenv.rstodo.todoist_action_cli,但现在已经被分离到它自己的包中,导入为:actionista.todoist_action_cli。
注意:此应用程序不是由 Doist 创建、附属或支持的。它是使用官方 Todoist API 的第三方命令行实用程序,如https://developer.todoist.com/sync/v8/所述。
安装:
安装pipx:
对于普通的最终用户,我建议使用pipx安装 Actionista-Todoist 命令行应用程序:
$ pipx install actionista-todoist
如果没有安装 pipx,可以参考 pipx 安装指南。简要地:
$ pip install pipx
$ pipx ensurepath
最后一步将添加~/.local/bin到 PATH 环境变量中。请确保在第一次安装 pipx 后关闭并重新启动终端/命令提示符。
已知的安装错误:
- 如果您正在使用
conda,则在尝试使用pipx. 如果您收到此错误,请更新您的condapython 并确保您只使用“defaults”通道,而不是“conda-forge”。
安装pip:
从 Python Packaging Index (PyPI) 安装发行版包:
$ pip install -U actionista-todoist
或者,通过从 github 获取 git 存储库并以可编辑模式(开发模式)安装包来安装最新的 git master 源:
$ git clone git@github.com:scholer/actionista-todoist && cd actionista-todoist
$ pip install -U -e .
配置:
安装包后,您需要从todoistactionista-todoist网站获取登录令牌:登录您的 todoist.com 帐户,转到Settings -> Integrations,然后复制 API 令牌。(您也可以直接进入页面:https ://todoist.com/prefs/integrations )。
现在运行:
$ actionista-todoist-config
使用您的 Actionista-Todoist 安装设置登录令牌。API 令牌存储在~/.todoist_token.txt. 该actionista-todoist-config命令还将创建一个默认配置文件 ,
~/.todoist_config.yaml您可以对其进行编辑以更改默认排序和打印格式。
如果您重新设置了您的 Todoist API 令牌,您可以通过运行以下方式更新它:
$ actionista-todoist-config --token <your-token-here>
或通过手动编辑文件~/.todoist_token.txt并将您的令牌放在这里。
用法:
该actionista-todoist软件包包含几个命令行应用程序 (CLI):
todoist-action-cli- 也可作为actionista-todoist.todoist-cli.actionista-todoist-config.
CLI 程序使用“todoist-action-cli动作链”方法,您可以在其中指定一系列“动作”,用于从 Todoist 过滤/选择任务,然后以批量方式对选定任务进行排序、打印或重新调度。
todoist-cliCLI 程序主要用于不符合“动作链”理念的事情。例如,如果您想添加一个新任务,它并不真正适合todoist-action-cli
工作流程。(*) 相反,您可以使用todoist-cli add-task命令向 Todoist 添加一个新任务。也用于其他事情,例如打印项目todoist-cli列表等。您可以运行todoist-cli --help以查看所有可用命令。
最后,actionista-todoist-configCLI 程序用于设置 Actionista-Todoist、配置您的 API 登录令牌并创建默认配置文件。
(*) 从todoist-action-cli技术上讲,可以使用
-add-taskaction 命令将任务添加到 Todoist - 但是,这不是推荐的方法。
todoist-action-cli用法:
一般的命令行用法是:
$ todoist-action-cli [actions]
$ todoist-action-cli [-action [args]]
action以下操作之一在哪里:
# Sorting and printing tasks:
-print Print tasks, using a python format string.
-sort Sort the list of tasks, by task attribute in ascending or descending order.
# Task selection (filtering):
-filter Generic task filtering method based on comparison with a specific task attribute.
-has Generic task filtering method based on comparison with a specific task attribute.
-is Special -is filter for ad-hoc or frequently-used cases, e.g. `-is not checked`, etc.
-not Convenience `-not` action, just an alias for `-is not`. Can be used as e.g. `-not recurring`.
-due Special `-due [when]` filter. Is just an alias for `-is due [when]`.
-contains Convenience filter action using taskkey="content", op_name="contains".
-startswith Convenience filter action using taskkey="content", op_name="startswith".
-endswith Convenience filter action using taskkey="content", op_name="endswith".
-glob Convenience filter action using taskkey="content", op_name="glob".
-iglob Convenience filter action using taskkey="content", op_name="iglob".
-eq Convenience filter action using taskkey="content", op_name="eq".
-ieq Convenience filter action using taskkey="content", op_name="ieq".
-content Convenience adaptor to filter tasks based on the 'content' attribute (default op_name 'iglob').
-name Convenience adaptor to filter tasks based on the 'content' attribute (default op_name 'iglob').
-project Convenience adaptor for filter action using taskkey="project_name" (default op_name "iglob").
-priority Convenience adaptor for filter action using taskkey="priority" (default op_name "eq").
-priority-eq Convenience filter action using taskkey="priority", op_name="eq".
-priority-ge Convenience filter action using taskkey="priority", op_name="ge".
-priority-str Convenience adaptor for filter action using taskkey="priority_str" (default op_name "eq").
-priority-str-eq Convenience filter action using taskkey="priority_str", op_name="eq".
-p1 Filter tasks including only tasks with priority 'p1'.
-p2 Filter tasks including only tasks with priority 'p2'.
-p3 Filter tasks including only tasks with priority 'p3'.
-p4 Filter tasks including only tasks with priority 'p3'.
# Updating tasks:
-reschedule Reschedule tasks to a new date/time.
-mark-completed Mark tasks as completed using method='close'.
-mark-as-done Mark tasks as completed using method='close'.
# Synchronizing and committing changes with the server:
-sync Pull task updates from the server to synchronize the local task data cache.
-commit Commit is a sync that includes local commands from the queue, emptying the queue. Raises SyncError.
-show-queue Show list of API commands in the POST queue.
-delete-cache Delete local todoist data cache.
-print-queue Show list of API commands in the POST queue.
# Program behavior:
-verbose, -v Increase program informational output verbosity.
-yes, -y Disable confirmation prompt before enacting irreversible commands, e.g. -commit.
-help, -h Print help messages. Use `-help <action>` to get help on a particular action.
要查看如何使用每个过滤器,请键入:
$ todoist-action-cli -help <action_name>
例如:
$ todoist-action-cli -help project
$ todoist-action-cli -help filter
$ todoist-action-cli -help reschedule
如您所见,典型用法是:
$ todoist-action-cli -sync [one or more filter actions to select the tasks] -sort -print
过滤动作可以是例如过滤-name(与 相同-content)、
project、due_date_local_iso等。-sync动作是可选的;如果您不指定-sync,则程序将重新使用您上次调用时的旧缓存-sync。-sync当您第一次安装此软件包时,您必须至少调用一次,并且-sync如果您在上次同步后进行了任何更改(例如从您的手机),您应该始终调用。最后,-sortand-print命令将排序和打印选定的任务。
如果您需要优化过滤器,只需再次运行该命令。数据缓存在本地,所以如果省略该-sync操作,可以快速连续执行命令。
另一个示例,要重新安排一堆任务的截止日期,如下所示:
$ todoist-action-cli [-sync] [filter actions] [-sort] [-print] -reschedule "Apr 21" -commit
注意:我强烈建议您-print在您之前过滤任务
-rename或-reschedule任务。当您调用-commit时,更改无法自动撤消,因此如果您在重命名或重新安排任务之前忘记应用正确的选择过滤器,您可能很容易得到一堆具有相同截止日期的同名任务!因此,默认情况下,程序会在每个-commit.
行动论据:
每个动作都可以提供一组参数,这些参数按顺序列出,用空格分隔。如果一个参数包含空格,例如您正在按项目“会议记录”中的任务进行过滤,那么您需要这样引用该参数:
$ todoist-action-cli -sync -project "Meeting notes" -sort "project_name,content" ascending -print
在这里,我们为动作 ( ) 提供了一个参数,为动作-project( )"Meeting notes"提供了两个参数。-sort"project_name,content"ascending
在解释给出的论点时,一些动作试图变得“聪明”。例如,按项目过滤时,您可以执行以下任一操作:
$ todoist-action-cli -project "Wedding*"
$ todoist-action-cli -project glob "Wedding*"
$ todoist-action-cli -project startswith Wedding
该-project操作的一般签名是:
$ todoist-action-cli -project [operator] value
这里,[operator]是许多已注册的二元运算符之一的名称。这些用于将任务与给定值进行比较。在上面的示例中,如果您未指定任何运算符,则使用“glob”运算符。“glob”运算符允许您使用通配符来选择任务,就像在命令行上选择文件一样。在我们的例子中,我们对项目名称以字符串“Wedding*”开头的任务进行“glob”。我们也可以使用“startswith”运算符,并省略星号: startswith Wedding。
有关如何使用运算符的更多信息,请参阅:
$ todoist-action-cli -help operators
临时 CLI:
安装此项目 ( actionista-todoist)pip还会为您提供一些“临时”命令行界面入口点:
$ todoist-adhoc <command> <args>
$ todoist-adhoc print-query <query> [<print-fmt>]
$ todoist-adhoc print-completed-today [<print-fmt>]
$ todoist-adhoc print-today-or-overdue-items [<print-fmt>]
# And a couple of endpoints with convenient defaults, e.g.:
$ todoist_today_or_overdue
现有技术:其他基于 python 的 Todoist 项目
我知道的其他 Todoist CLI 软件包:
-
todoist-cli - 用于从文件批量创建 Todoist 任务的命令行界面。针对 web API url 发出手动请求(而不是使用官方的 todoist-python 包)。自 2016 年 1 月以来没有更新(
setup.py和除外requirements.txt)。这可能不起作用,因为它使用旧的、过时的 API 端点 URL。 -
todoicli - 一个相当新的项目(截至 2018 年 4 月)。专注于列出任务的预定义查询,例如“今天和过期”、“未来 7 天”等。许多其他功能,相当广泛的代码库。与 toggl.com 时间跟踪服务集成。使用官方
todoist-python包,但仍使用旧 v7 Sync API 中的“通用 UTC”时间格式和 v7 到期日期结构。这意味着它可能不再工作,因为 v7 Sync API 已被弃用,并且todoist-python包已切换到 Sync API v8。例如,list tdandlist n7使用item['due_date_utc'],它将KeyError使用新的 v8 数据结构引发 a。CLI 还期望IDs(task_id,label_id,project_id),而不是文本名称,这使得最终用户很难使用。 -
pydoist - 从命令行添加 Todoist 任务的基本 CLI。
todoist-python使用来自 Todoist的官方python API。最新版本是 2016 年 11 月,因此可能不适用于新的 v8 Sync API。
其他通用 python Todoist 包:
-
python-todoist - 来自 Doist(Todoist 背后的公司)的官方 python 'Todoist' 包。当前正在使用 8.0 版“同步”API。
-
pytodoist - 一个替代的 Todoist API 包。还使用 v7 Sync API。一种完全不同的 API 包装方法,可能更面向对象。专注于对单个用户/项目/任务/注释进行建模,其中官方的 todoist-python 包以管理器为中心单元(ItemsManager、ProjectsManager、NotesManager)。
- 上次更新 2016 年 11 月 - 删除 v7 Sync API 后将过时。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
内置分布
actionista -todoist-2019.9.16.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | dc8b751b26d42a8ddf02cea739138fc3106ff3f874d11f2f79cf8f7a591ff658 |
|
| MD5 | 34fd2d258c38300ddd58863295fbbfb1 |
|
| 布莱克2-256 | 882fe3f1551d1ccb2ef45fff1576c565f98525dc044c9dc4a8feca9f731946ee |
actionista_todoist -2019.9.16-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 6ea37121004b7d92863a4fc17f49a4231738c9bcd86eec8d453b2c4599f9d20e |
|
| MD5 | 6dbbbd90c3aaffd62a5f274478b7c126 |
|
| 布莱克2-256 | 8b87d8dcf7e2e76e28815bf987a017e4ffc64a2f7d3c3623c85dc21bfa01c0bf |