Skip to main content

Python SDK for the Parze API

Project description

Parze Python SDK

Official Python client for the Parze document parsing API.

Installation

pip install parze

Quick Start

from parze import ParzeClient

# Initialize client with your API key
client = ParzeClient(api_key="pk_live_your_key_here")

# Parse a document
result = client.parse("invoice.pdf")
print(result["text"])

# Extract structured data (one step)
schema = {
    "invoice_number": {"type": "string", "description": "Invoice number"},
    "total_amount": {"type": "string", "description": "Total amount"},
    "date": {"type": "string", "description": "Invoice date"}
}
extraction = client.extract(file="invoice.pdf", extraction_schema=schema)
print(extraction["extraction"])

# To avoid double billing, parse first and then extract with job_id
parse_result = client.parse("invoice.pdf")
extraction = client.extract(parse_result["text"], schema, parse_result["job_id"])

# Get AI-suggested schema
suggested = client.suggest_schema(text)
print(suggested)

API Reference

parse(file, output_format="structured", preserve_tables=True, preserve_layout=True, extraction_mode="auto")

Parse a document into structured text.

Parameters:

  • file (str or file object): Path to file or file object
  • output_format (str): "structured", "markdown", or "json"
  • preserve_tables (bool): Preserve table structure
  • preserve_layout (bool): Preserve document layout
  • extraction_mode (str): "auto", "ocr_only", "llm_only", or "identity_doc"

Returns: Dict with parsed text and metadata

extract(text=None, extraction_schema=None, job_id=None, file=None)

Extract structured data from a file or parsed text using a schema.

Parameters:

  • text (str, optional): Document text (from parse)
  • extraction_schema (dict, required): Schema defining fields to extract
  • job_id (str, required if text is provided): Job ID from parse response
  • file (str or file object, optional): Path to file or file object (if provided, parse runs internally)

Returns: Dict with extracted data and confidence scores

suggest_schema(text)

Get AI-suggested extraction schema based on document text.

Parameters:

  • text (str): Document text

Returns: Dict with suggested schema

text_to_schema(description)

Convert natural language description to extraction schema.

Parameters:

  • description (str): Natural language description of fields

Returns: Dict with generated schema

Get API Key

Get your API key from platform.parze.ai

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

parze-0.2.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

parze-0.2.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file parze-0.2.2.tar.gz.

File metadata

  • Download URL: parze-0.2.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for parze-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5d25eacef093b107dc89b38a5a8e96cba025a83fa97be55f773016d69f4f77f3
MD5 2daa5dd1fa66ebed37bb7444d754644a
BLAKE2b-256 9778519e1c1850d8258027dcf348d2a89d7665164c3f3fb93fe2987b65d8bf5b

See more details on using hashes here.

File details

Details for the file parze-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: parze-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for parze-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a811c384a4ccabcbbeccd8e2da1f118343311e273404157faf0f25043a05b4d
MD5 0630587e7b26beb981ac251ffdf7f698
BLAKE2b-256 582626fcd4b7a1d6252f6223d8bc4f1ca4b9a4ece7802bcb86560d4f013fc50f

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