Python对Hypothesis注释系统的封装
项目描述
Hypothesis
Hypothesis API的Python封装
使用TextQuoteSelector创建注释
h = hypothesis.Hypothesis(username=USER, token=TOKEN) # your h username and api token (from https://hypothes.is/account/developer)
url = 'url of web page to annotate'
exact = 'selected text (i.e. the quote)'
prefix = '30 chars preceding the quote'
suffix = '30 chars following the quote'
title = 'title of the web page'
tags = ["tag1", "tag2"]
text = "body of annotation, can include [markup](http://example.com)"
payload = {
"uri": url,
"target":
[{
"source": [url],
"selector":
[{
"type": "TextQuoteSelector",
"prefix": prefix,
"exact": exact,
"suffix": suffix
}
]
}],
"tags": tags,
"text": text,
"document": {
"title": [title]
},
"permissions": h.permissions,
"group": h.group
}
r = h.post_annotation(payload)
print r.status_code
项目详情
关闭
hypothesis-api-1.0.2.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | afa8e8db482d6b25cbecf60c5bc3a822d6326a5a865f7bf27bf9d0ac5e60980a |
|
MD5 | a841ca7b2cb74a07d2760b9c88457292 |
|
BLAKE2b-256 | 94827916389957e9383ed3e74214f9a8ca609fb7d920fa2aefec4e5d4b764f34 |