Skip to main content

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_api_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doccano-client-1.1.0.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

doccano_client-1.1.0-py3-none-any.whl (48.9 kB view details)

Uploaded Python 3

File details

Details for the file doccano-client-1.1.0.tar.gz.

File metadata

  • Download URL: doccano-client-1.1.0.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for doccano-client-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1cb39cc811cf79ac441a2b407f14e1fef9a71aaf6e4128e6e6aca4f7710f0ef0
MD5 55144012609de4bc5da057834bc7e91e
BLAKE2b-256 8b8dbc7327213ace1bbbd5a84a4b311072d80946746f3bb5c26c212b394b20a3

See more details on using hashes here.

File details

Details for the file doccano_client-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for doccano_client-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff1bba04e4c08a8305783260f7e562e5955e68ff40a05a17894b61b43eacfd4a
MD5 90c2efe9d65c16022e52ec7f76ba3505
BLAKE2b-256 fbd0f782770c4960d537c1e2851e2cbd19d8bf67622110c4b3febfbbd5c01d9f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page