Skip to main content

kes-tools-sdk

Python SDK for the kes-tools website, which turns PDFs and Kurzweil 3000 .kes files into .kes files with OCR, layout and reading order from Datalab, tuned so Kurzweil reads whole sentences.

Conversions run on the kes-tools website with your account and the Datalab API key you set up there, so they are billed to your Datalab account. For the command line, install kes-tools instead, which is built on this package.

Install

pip install kes-tools-sdk                 # or: uv add kes-tools-sdk
pip install 'kes-tools-sdk[keyring]'      # to store a sign-in in the system keychain with Client.login()

Python 3.9 or newer, on Windows, macOS and Linux. Only depends on httpx.

Sign in

The SDK needs a kes-tools sign-in, as a refresh token:

  • If you use the CLI, kes-tools login stores one in the system keychain, and Client() finds it there (with the keyring extra installed).
  • On servers and in CI, set KES_TOOLS_REFRESH_TOKEN (from kes-tools login --export) or pass Client(refresh_token=...). This needs no keyring.
  • Client().login() signs in from Python through the browser and stores the result in the keychain.

Use

from kes_tools import Client

with Client() as client:
    for result in client.convert(["book.pdf", "chapter.kes"], output="converted"):
        print(result.file, "->", result.output if result.ok else result.error)

Client() uses the sign-in from kes-tools login (or $KES_TOOLS_REFRESH_TOKEN); pass refresh_token= to use another one, and url= for another deployment. client.login() signs in from Python, through the browser.

Method Does
convert(files, output=".", mode="balanced", image="color", timeout=3600, overwrite=False, wait=True, progress=None) Uploads, waits and downloads; returns a ConversionResult per file (file, job, output, error, ok). A file that fails gets error instead of raising. With wait=False it only uploads and starts.
submit(path, mode, image) Uploads one file and starts it; returns its Job.
wait(jobs, timeout=3600) Waits until the jobs are done or failed; returns the Jobs.
download(job, folder=".", overwrite=False) Saves a done job's result; returns its path.
jobs(status=None), job(job) Your conversions, newest first, or one of them.
delete(jobs) Deletes conversions and their files; returns how many.
account() Account(email, has_datalab_key, key_hint).

The full reference is at https://dbqmri38t4eq6.cloudfront.net/docs/sdk/kes_tools.html.

A Job has id, status (awaiting_upload, queued, processing, done or failed), filename, kind, mode, image, pages, cost_cents, error and created_at, plus running, done and failed. Jobs and files can be passed as objects or ids and paths.

Errors derive from KesToolsError: AuthError (not signed in, or the sign-in expired), ApiError (with status) and MissingDatalabKey (add the key in Settings on the website). The package is typed.

License

Apache License 2.0. The full text is in the LICENSE file included in the package.

Metadata

Release files for kes-tools-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kes-tools-sdk 0.1.1
File Size Uploaded Provenance Actions
kes_tools_sdk-0.1.1.tar.gz 83.4 kB With provenance Details for kes_tools_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kes-tools-sdk 0.1.1
File Interpreter ABI Platform Actions
kes_tools_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for kes_tools_sdk-0.1.1-py3-none-any.whl

Total release size: 99.8 kB

Release files / kes_tools_sdk-0.1.1.tar.gz

Download URL kes_tools_sdk-0.1.1.tar.gz
Size 83.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8ca7de30d40d7a6ed03fff7afbb9b4780f62c61f9a8b2bdbb5cdd9719a190d19
BLAKE2b-256 checksum
How to use checksums
f2ad221066328fff2f9f59f42c3240529d2551c745a274eebc473973d1c1682b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / kes_tools_sdk-0.1.1-py3-none-any.whl

Download URL kes_tools_sdk-0.1.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6959cfeede6c2fac657f1f599f50e184daab65a4839976d461a7e3f2a69ad539
BLAKE2b-256 checksum
How to use checksums
605465263a45302b603221dc737b6e51bef6b3bcf1c7f7b996806eaefa9bde58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for kes-tools-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kes_tools_sdk-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page