Skip to main content

Official Python client for the Kreuzberg Cloud document-processing API.

Project description

kreuzberg-cloud-sdk

Kreuzberg Cloud

PyPI npm Go Reference License Documentation CI

Discord

Official Python client for the Kreuzberg Cloud document-processing API.

  • httpx-based, sync (KreuzbergCloud) and async (AsyncKreuzbergCloud) surfaces
  • Generated from the upstream OpenAPI 3.1 spec, then wrapped in ergonomic helpers
  • Type-annotated end to end, py.typed shipped
  • Zero-friction onboarding via from_sandbox() — no signup needed for evaluation

Install

pip install kreuzberg-cloud-sdk
# or
uv add kreuzberg-cloud-sdk

Requires Python 3.10+.

Quickstart

Sync — single file with explicit API key

from pathlib import Path
from kreuzberg_cloud import KreuzbergCloud

with KreuzbergCloud(api_key="sk_live_...") as client:
    job = client.extract_and_wait(file=Path("invoice.pdf"))
    if job.result is not None:
        print(job.result.content)

Async — batch extract with parallel waits

import asyncio
from pathlib import Path
from kreuzberg_cloud import AsyncKreuzbergCloud

async def main() -> None:
    async with AsyncKreuzbergCloud(api_key="sk_live_...") as client:
        jobs = await client.extract_batch([Path("a.pdf"), Path("b.pdf"), Path("c.pdf")])
        results = await client.wait_for_jobs([str(j.id) for j in jobs])
        for job in results:
            print(job.filename, job.status)

asyncio.run(main())

Async — sandbox onboarding (no API key required)

import asyncio
from kreuzberg_cloud import AsyncKreuzbergCloud

async def main() -> None:
    async with await AsyncKreuzbergCloud.from_sandbox() as client:
        job = await client.extract_and_wait(file=b"hello world")
        print(job.status, job.result and job.result.content)

asyncio.run(main())

Public API

The following methods are available on both KreuzbergCloud (sync) and AsyncKreuzbergCloud (async):

Method Purpose
extract(file=..., options=...) Submit one document, get back a Job.
extract_batch(files, options=...) Submit many documents (parallel for async).
get_job(job_id) Fetch current job status / result.
wait_for_job(job_id, timeout=300, ...) Poll until terminal status.
wait_for_jobs(job_ids, ...) Wait for multiple jobs.
extract_and_wait(file=..., ...) Submit + wait in one call.
create_sandbox_key() Mint an ephemeral sandbox API key.
from_sandbox() (classmethod) Build a client preconfigured with a sandbox key.

Errors are raised as one of: KreuzbergCloudError (base), AuthError, ValidationError, NotFoundError, RateLimitError (carries retry_after), ServerError, TimeoutError.

Documentation

Full reference and guides: https://docs.kreuzberg.cloud

License

MIT — © Kreuzberg, Inc.

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

kreuzberg_cloud_sdk-0.3.1.tar.gz (110.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kreuzberg_cloud_sdk-0.3.1-py3-none-any.whl (279.1 kB view details)

Uploaded Python 3

File details

Details for the file kreuzberg_cloud_sdk-0.3.1.tar.gz.

File metadata

  • Download URL: kreuzberg_cloud_sdk-0.3.1.tar.gz
  • Upload date:
  • Size: 110.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kreuzberg_cloud_sdk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 540c493b4dc6b1ed202867122ae239898c56700b9db4ddf3925d0eac9a9720b6
MD5 0e1540e4d333f898ca57767fde25f48d
BLAKE2b-256 c40457a4c4fec67f9d2723e79958080784fa84b1f0d5107c112c5e60ca9b2002

See more details on using hashes here.

Provenance

The following attestation bundles were made for kreuzberg_cloud_sdk-0.3.1.tar.gz:

Publisher: publish.yaml on kreuzberg-dev/kreuzberg-cloud-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kreuzberg_cloud_sdk-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kreuzberg_cloud_sdk-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 489eeacc60cfee2e8a619f8b04ad720482f76773a8dc672d837df32f576999e3
MD5 7dae5cc7d6478a601e92e57407883a1a
BLAKE2b-256 08e46ebf4504eddd82d07bd826a907f5bc7f5632daf27b06eabec1d11e8aab57

See more details on using hashes here.

Provenance

The following attestation bundles were made for kreuzberg_cloud_sdk-0.3.1-py3-none-any.whl:

Publisher: publish.yaml on kreuzberg-dev/kreuzberg-cloud-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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