Skip to main content

AI-powered document intelligence platform - Turn your data into structured data with a single line of code.

Project description

ByteIT Python SDK

ByteIT is a Python client for document parsing and structured extraction. Use it to submit files, retrieve parsed content, and extract schema-based data from completed parse jobs.

Installation

pip install byteit

Requires Python 3.8+ and a ByteIT API key.

Quick Start

from byteit import ByteITClient

client = ByteITClient(api_key="your_api_key")
result = client.parse("document.pdf")
print(result.decode("utf-8"))

parse() returns raw bytes. Pass output="result.json" to write the result directly to disk.

Parse Documents

from byteit import ByteITClient, ProcessingOptions

client = ByteITClient(api_key="your_api_key")

result = client.parse(
    "invoice.pdf",
    processing_options=ProcessingOptions(languages=["en"], page_range="1-2"),
)

Public parse submission methods always request JSON output internally. If you need another format, request it when downloading an async result.

Async Workflow

job = client.parse_async("document.pdf")

status = client.get_job_status(job.id)
details = client.get_parse_job_details(job.id)

if status.is_completed:
    result_json = client.get_parse_job_result(job.id)
    result_txt = client.get_parse_job_result(job.id, result_format="txt")

Available parse-job methods:

Method Purpose
get_parse_jobs() List parse jobs
get_parse_job_details(job_id) Get full parse-job details
get_job_status(job_id) Check lightweight processing status
get_parse_job_result(job_id, result_format=None) Download parse result

Structured Extraction

Extraction runs on a completed parse job and returns a dictionary matching your schema.

from byteit import ByteITClient, ExtractionSchema
from pydantic import Field


class InvoiceSchema(ExtractionSchema):
    invoice_number: str | None = Field(description="Invoice number")
    total_amount: str | None = Field(description="Total amount")


client = ByteITClient(api_key="your_api_key")
parse_job = client.parse_async("invoice.pdf")

result = client.extract(
    parse_job.id,
    InvoiceSchema,
    extraction_complexity="medium",
)

Async extraction is also available:

extract_job = client.extract_async(parse_job.id, InvoiceSchema)

status = client.get_job_status(extract_job.id)
if status.is_completed:
    extracted = client.get_extract_job_result(extract_job.id)

Available extraction methods:

Method Purpose
extract(parse_job_id, schema, output=None, extraction_complexity="medium") Run extraction and wait for the result
extract_async(parse_job_id, schema, extraction_complexity="medium") Submit extraction without waiting
get_extract_jobs() List extraction jobs
get_extract_job_details(job_id) Get full extraction job details
get_extract_job_result(job_id) Download extraction result

Processing Options

You can pass either a ProcessingOptions instance or a plain dictionary.

result = client.parse(
    "document.pdf",
    processing_options={
        "languages": ["de", "en"],
        "page_range": "1-5",
        "extraction_type": "complex",
    },
)

Error Handling

All SDK exceptions inherit from ByteITError.

from byteit.exceptions import (
    AuthenticationError,
    ByteITError,
    JobProcessingError,
    RateLimitError,
    ValidationError,
)

try:
    result = client.parse("document.pdf")
except AuthenticationError:
    print("Invalid API key")
except ValidationError as exc:
    print("Invalid request:", exc.message)
except RateLimitError:
    print("Rate limit exceeded")
except JobProcessingError as exc:
    print("Processing failed:", exc.message)
except ByteITError as exc:
    print("ByteIT error:", exc.message)

Supported Inputs

Common supported inputs include PDF, Word, PowerPoint, HTML, Markdown, plain text, JSON, XML, and common image formats such as PNG, JPEG, TIFF, and BMP.

Notebook Behavior

When running in Jupyter, parse results are automatically displayed as JSON when possible. Pass output=... if you want to suppress inline display and save the response directly.

Resources

Licensed under Apache 2.0. © 2026 ByteIT GmbH.

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

byteit-1.1.1.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

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

byteit-1.1.1-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file byteit-1.1.1.tar.gz.

File metadata

  • Download URL: byteit-1.1.1.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for byteit-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0201ca7f5e9cd1704a66300ae62eff1208e92a267932fe1d8b696458d3cfc736
MD5 b0f063cde8db1c92656d970f8a733a8b
BLAKE2b-256 2cd4e3c87e3eff1e3452c49e4fa7316a64b242225b1c15c5d7fbcf69d5d7611c

See more details on using hashes here.

File details

Details for the file byteit-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: byteit-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for byteit-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5af3122116b0a9ba1ce586ab57b47afe3bbb97e3b312b8dc22847b403f9148e6
MD5 1ea3f0ada653a1cf0b5d709377178e5e
BLAKE2b-256 9ea945e3d15b6888b6955043cd7b7eeb7e6c4c2907ca11d0c7b99a8789bba3f0

See more details on using hashes here.

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