Python wrapper for the Hypothesis annotation system
Project description
Hypothesis
A python wrapper for the Hypothesis API
Create an annotation using a 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hypothesis-api-1.0.1.tar.gz
(4.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hypothesis-api-1.0.1.tar.gz.
File metadata
- Download URL: hypothesis-api-1.0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c41c2d1e94ec955aeeb3cb4fb743d7e8d25b750bd04410fd9a269a2eab245a5d
|
|
| MD5 |
d9b59207fc1c13277f5e8aa5d5fe5841
|
|
| BLAKE2b-256 |
e4d8bbdcfb5660a62a26595f32da770b6ecc05f69a64a63fdfd38b00c3821fcf
|
File details
Details for the file hypothesis_api-1.0.1-py3-none-any.whl.
File metadata
- Download URL: hypothesis_api-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc59fe4cae85072c60c833dc30b2e2ece69af19bc97338c855d0671d76d31a2b
|
|
| MD5 |
a1801103a973cb10db49899c8dff3717
|
|
| BLAKE2b-256 |
18e378fbe76e53537680b8e699714d24b66a4333eb99ceca8d895a8a3c952210
|