一个简单的只读CLI、API和Web服务

things3-api的Python项目详细描述


GitHub ReleaseLicensePyPI - DownloadsGitHub Download CountGitHub IssuesScrutinizer Code QualityBuild StatusCoverage Status

CLI、API、Web服务和看板3

此存储库包含一个简单的只读CLI、API和Things3的Web服务。它还包括一个示例web应用程序,用于创建一个可视化的任务级概述(看板)。在

view2020

安装

为了节省时间和支持开发,请考虑从AppStore购买预编译的二进制文件:

AppStore

除此之外,你还有不同的选择:

  1. 下载release。在
  2. 安装库和命令行工具:pip3 install things3-api
  3. Star,fork并贡献给最新的代码:git clone https://github.com/AlexanderWillner/KanbanView.git

配置

虽然一切都应该开箱即用,但您可能需要更改一些配置方面的内容。要有一个图形用户界面,这是Feature Request #19。目前,这里显示了以下默认值,您可以通过创建文件~/.kanbanviewrc(自编译版本)/~/Library/Containers/ws.willner.kanbanview/Data/~/.kanbanviewrc(AppStore版本)或将它们设置为环境变量来更改它们。请注意,普通整型标记(例如515、或{})用于计算今天任务工期的估计时间:

[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应用程序中的版本。在

启用项目模式的暗模式:

dark-mode

任务类型:

stat-types

任务操作的历史记录:

stat-types

项目整体观:

stat-types

今天计划了多少分钟(计算带有普通数字的标记,如51530)并查看艾森豪威尔矩阵中的任务(使用标记ABCD):

stat-types

通过iPad遥控:

stat-types

命令

下载命令行工具或下载源代码并执行make install之后,您的路径中就有了工具things-clithings-api和{}。其他可用的make命令通过执行make列出:

^{pr2}$

命令行界面(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

Excel

但是,CLI仅处于开始状态。基于^{的原始版本可以在another GitHub repo找到。总体命令包括:

$ 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
  }]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在OSGI中使用cxf生成的客户端时出现Java类装入器问题和JaxB异常   java为什么要在javamail中迭代多部分电子邮件中的部分?   并发编程问题   JFileChooser&&System中未调用java windowClosing。退出功能不正常?   SQL查询的java语法分析   java如何使用AspectJ声明字段上的警告   什么是java向量。元素()C#等价物   java解析Android应用程序中tornado web服务中的CSV文件   java我试过c2dm,我需要服务器端   java调整JPanel大小以适应新的JLabel图标   Java与Python脚本的通信   java使用Saxon通过XSLT生成URL   java net::ERR_complete_CHUNKED_编码200(OK)来自struts应用程序中的tomcat   java如何为我的窗格设置不同的位置?   java使用Cypher Neo4j获取给定类型的所有节点(从SQL世界中的tablename中选择*)   nio使用Java解析文件值   java使用WSDL生成REST客户端会是错误的方向吗?   java如何在我的应用程序中构建类映射?   java按钮。setEnabled在第一个循环中不起作用   xPath适用于最后一页,但不适用于第一页