一个简单的只读CLI、API和Web服务
things3-api的Python项目详细描述
CLI、API、Web服务和看板3
此存储库包含一个简单的只读CLI、API和Things3的Web服务。它还包括一个示例web应用程序,用于创建一个可视化的任务级概述(看板)。在
安装
为了节省时间和支持开发,请考虑从AppStore购买预编译的二进制文件:
除此之外,你还有不同的选择:
- 下载release。在
- 安装库和命令行工具:
pip3 install things3-api
- Star,fork并贡献给最新的代码:
git clone https://github.com/AlexanderWillner/KanbanView.git
配置
虽然一切都应该开箱即用,但您可能需要更改一些配置方面的内容。要有一个图形用户界面,这是Feature Request #19。目前,这里显示了以下默认值,您可以通过创建文件~/.kanbanviewrc
(自编译版本)/~/Library/Containers/ws.willner.kanbanview/Data/~/.kanbanviewrc
(AppStore版本)或将它们设置为环境变量来更改它们。请注意,普通整型标记(例如5
、15
、或{
[DATABASE]THINGSDB=/Users/myname/Library/Group Containers/JLMPQHK86H.com.culturedcode.ThingsMac/Things Database.thingsdatabase/main.sqliteTAG_WAITING=WaitingTAG_MIT=MITTAG_CLEANUP=Cleanup
应用
看板应用程序允许您按照看板方法(专注于任务或项目)可视化Things3数据库。它还包括一些可视化效果。有不同的应用程序实现。在
static版本创建当前状态的快照,并将HTML文件写入kanban-static.html
:make run
。在
dynamic版本在http://localhost:15000/kanban.html运行一个web应用程序,并使用web服务通过JavaScript自动更新GUI。在
app版本通过make run-app
运行macOS应用程序。您还可以创建编译包看板视图.app将脚本封装到易于使用的独立macOS应用程序中的版本。在
启用项目模式的暗模式:
任务类型:
任务操作的历史记录:
项目整体观:
今天计划了多少分钟(计算带有普通数字的标记,如5
,15
,30
)并查看艾森豪威尔矩阵中的任务(使用标记A
,B
,C
,D
):
通过iPad遥控:
命令
下载命令行工具或下载源代码并执行make install
之后,您的路径中就有了工具things-cli
、things-api
和{make
命令通过执行make
列出:
命令行界面(CLI)
CLI允许您通过命令行访问Things3数据库:
$ things-cli inbox - Inbox Todo ( None )
也可以获得格式化为json
字符串的信息:
$ things-cli --json next | jq [{"uuid": "9CD92553-95D7-4CF2-B554-F1DE9F563018", "title": "Due Todo", "context": "Next Project", "context_uuid": "DED787E0-874A-4783-8F0F-0A02F87F8419", "due": "2152-08-28"}, {"uuid": "4C5D620C-165C-41D2-BC5B-A34065348D92", "title": "Today Project Todo", "context": "Today Project", "context_uuid": "52ADBAB5-A0EC-4D3F-BF83-2D578DAE3AF3", "due": null }, {"uuid": "2ECBE4AA-2E3F-49CC-AA38-CBFFBFD2B1FD", "title": "Todo with Checklist", "context": "Next Project", "context_uuid": "DED787E0-874A-4783-8F0F-0A02F87F8419", "due": null }, {"uuid": "709794DA-EB89-4A1B-BBE5-2BF8424BBA28", "title": "Waiting for Todo", "context": "Next Project", "context_uuid": "DED787E0-874A-4783-8F0F-0A02F87F8419", "due": null }]
此外,您可以通过$ things-cli --csv all > tasks.csv
将数据导出为csv
,并通过File > Import > CSV file > Delimited / UTF-8 > Comma
将文件导入Excel
:
但是,CLI仅处于开始状态。基于^{
$ things-cli -h usage: things3_cli.py [-h][-j][-c][--version]command ... Simple read-only Thing 3 CLI. positional arguments: command One of the following commands: inbox Shows all inbox tasks today Shows all todays tasks upcoming Shows all upcoming tasks next Shows all next tasks someday Shows all someday tasks completed Shows all completed tasks cancelled Shows all cancelled tasks trashed Shows all trashed tasks feedback Give feedback all Shows all tasks csv Exports all tasks as CSV due Shows all tasks with due dates headings Shows all headings hours Shows how many hours have been planned today ical Shows all tasks ordered by due date as iCal logbook Shows all tasks completed today mostClosed Shows days on which most tasks were closed mostCancelled Shows days on which most tasks were cancelled mostTrashed Shows days on which most tasks were trashed mostCreated Shows days on which most tasks were created mostTasks Shows projects that have most tasks mostCharacters Shows tasks that have most characters nextish Shows all nextish tasks old Shows all old tasks projects Shows all projects repeating Shows all repeating tasks schedule Schedules an event using a template search Searches for a specific task stat Provides a number of statistics statcsv Exports some statistics as CSV subtasks Shows all subtasks tag Shows all tasks with the waiting for tag tags Shows all tags ordered by their usage waiting Shows all tasks with the waiting for tag optional arguments: -h, --help show this help message and exit -j, --json output as JSON -c, --csv output as CSV --version show program's version number and exit
应用程序编程接口(API)
API允许您在其他Python脚本中访问Things3 todo:
$ make doc ... class Things3(builtins.object)| Things3()|| Simple read-only API for Things 3. || Methods defined here: || get_anytime(self)| Get anytime tasks. || get_inbox(self)| Get all tasks from the inbox. ...
Web服务
web服务允许您通过web服务访问Things3数据库:
$ make run-server Starting up... Serving API at http://localhost:15000/api/{command}
通过curl
您可以通过命令行浏览json
数据:
$ curl -s http://localhost:15000/api/today | jq [{"uuid": "D7D879D2-5A2D-48AA-AF8A-AADCEC228D2B", "title": "Today Todo", "context": "Today Project", "context_uuid": "52ADBAB5-A0EC-4D3F-BF83-2D578DAE3AF3", "due": null }]
- 项目
标签: