Nozbe接口封装。
项目描述
mekk.nozbe 将 (注意部分) Nozbe API 封装为Python函数。
它使用旧版已发布的API (http://www.nozbe.com/gtd/api) 和新的(尚未官方文档化的)“同步API”。这两个API都没有完全覆盖(模块支持2009年初有效的功能,这是我需要的),但我仍然成功地使用这个库从Nozbe提取项目和任务,并创建新的(或更新现有的)条目。
当前代码正在使用Twisted网络接口(这意味着返回deferred等)。嗯,我喜欢Twisted。我考虑提供基于urllib的同步API作为替代方案,只需要一些动力。
nozbetool
除了库之外,还包含nozbetool脚本。运行
nozbetool --help
获取详细信息。最常见用法
nozbetool export --csv=file.csv --user=YourNozbeUsername
(导出到.csv)或
nozbetool export --json=file.json --user=YourNozbeUsername --completed
(导出到.json,包括已完成的操作)。
注意:只有.json导出包含备注!
开发
示例
一些简单的示例
from mekk.nozbe import NozbeApi, NozbeConnection from twisted.internet import reactor, defer # API KEY servers as an authentication token. # Check for your own at Nozbe extras page (http://www.nozbe.com/account/extras). # Note that publishing it is equivalent to publishing the password. API_KEY = "grab your own from Nozbe" @defer.inlineCallbacks def make_some_calls(): connection = NozbeConnection(API_KEY) nozbe_client = NozbeApi() print "* Some projects" projects = yield nozbe_client.get_projects() for project in projects[:3]: print project print print "* Some contexts" contexts = yield nozbe_client.get_contexts() for context in contexts[:3]: print context print print "* Some tasks" tasks = yield nozbe_client.get_tasks() for task in tasks[:3]: print task print print "Adding example task" yield nozbe_client.add_task( u"Example task made using script", project_hash = projects[0]['hash'], context_hash = contexts[0]['hash'], next = 1) @defer.inlineCallbacks def main(): try: yield make_some_calls() finally: reactor.stop() reactor.callLater(0, main) reactor.run()
项目详情
关闭
meck.nozbe-0.4.2.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7526cb3357eff5684f332e8ee58e362fc6f3f2e87cbc32bbcab98a5ebc942f1c |
|
MD5 | 4c3f0a6fe4fd5e6a16b92d500edefd51 |
|
BLAKE2b-256 | 1d165f60e3aa47f12702c09c9a6ba6c181ba8731b641d24d94cece4891296e31 |