A simple client for doccano API.
Project description
Doccano API Client
A simple client wrapper for the doccano API.
Installation
To install doccano-client
, simply run:
pip install doccano-client
Usage
- Object instantiation takes care of session authorization.
- All methods return a
requests.models.Response
object.
from doccano_client import DoccanoClient
# instantiate a client and log in to a Doccano instance
doccano_client = DoccanoClient(
'http://doccano.example.com',
'username',
'password'
)
# get basic information about the authorized user
r_me = doccano_client.get_me()
# print the details from the above query
print(r_me)
# get the label text from project 1, label 3
label_text = doccano_client.get_label_detail(1, 3)['text']
# upload a json file to project 1. If file is in current directory, file_path is omittable
r_json_upload = doccano_client.post_doc_upload(1, 'json', 'file.json', '/path/to/file/without/filename/')
Info: Uploading documents has been reported as broken, but it works with the beta-client (see below)
Completion
This wrapper's methods are based on doccano url paths.
Key:
- ✔️ implemented
- ❌ not implemented
- ⚠️ currently broken or improperly implemented
Endpoint Names:
- ✔️
auth-token
- ✔️
me
- ✔️
user_list
- ✔️
roles
- ✔️
features
- ✔️
project_list
- ✔️
project_detail
- ✔️
statistics
- ✔️
label_list
- ✔️
label_detail
- ❌
label_upload
- ✔️
doc_list
- ✔️
doc_detail
- ✔️
doc_uploader
- ❌
cloud_uploader
- ✔️
approve_labels
- ✔️
annotation_list
- ⚠️
annotation_detail
- ✔️
doc_downloader
- ✔️
rolemapping_list
- ⚠️
rolemapping_detail
To-Do
- investigate more secure alternatives to plaintext login
- improve docstrings
Doccano API BETA Client
We're introducing a newly revamped Doccano API Client that features more Pythonic interaction as well as more testing and documentation. It also adds more regulated compatibility with specific Doccano release versions.
You can find the documentation on usage of the beta client here.
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
Built Distribution
File details
Details for the file doccano-client-1.1.1.tar.gz
.
File metadata
- Download URL: doccano-client-1.1.1.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6e5423dc783ca2df64fad4a84d3f34f84da1be1fd82ade9179c4df833e16029 |
|
MD5 | 68649d98cfbb57c4b2ff6064c3ff7a04 |
|
BLAKE2b-256 | 89417c7a3dc592c0bfd1824935f18a5978014d59103466a2fa48c8a5e720c8e6 |
File details
Details for the file doccano_client-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: doccano_client-1.1.1-py3-none-any.whl
- Upload date:
- Size: 64.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf9332d15b8d34cd8d9353f0261e8b8e1d984263074905f3d414efc77fd0797 |
|
MD5 | b2eaa5721128e09e6b2c60492c1a4bfb |
|
BLAKE2b-256 | 61c2ad824b8754a3ed64607ec6062911f09720c20a732aac1f2e321f7887dd87 |