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).

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.0

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.0
File Size Uploaded Provenance Actions
kes_tools_sdk-0.1.0.tar.gz 83.0 kB With provenance Details for kes_tools_sdk-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 98.8 kB

Release files / kes_tools_sdk-0.1.0.tar.gz

Download URL kes_tools_sdk-0.1.0.tar.gz
Size 83.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1d69f18a9a3c948e1f0f33e5e5fdc9b9fdb920240cd105a02a04d3da44f061b4
BLAKE2b-256 checksum
How to use checksums
a08a3c81f8d47916dec7e1627cd232250ec48294f6859421cd1a37652c5d1c29
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 13, 2026.

Transparency log

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

Download URL kes_tools_sdk-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c35e3eafff9b2f1361bf085f8861ac270b920f6079f381640a1e446f05434a5e
BLAKE2b-256 checksum
How to use checksums
d1547304adfe0d2f8afc82134b1a58552c105919f8ecf68adb29c5fa3cba67c1
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 13, 2026.

Transparency log

Security for kes-tools-sdk 0.1.0

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.0.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 13, 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.0 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