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
text = result["text"]
schema = {
    "invoice_number": {"type": "string", "description": "Invoice number"},
    "total_amount": {"type": "string", "description": "Total amount"},
    "date": {"type": "string", "description": "Invoice date"}
}
extraction = client.extract(text, schema)
print(extraction["extraction"])

# 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, extraction_schema)

Extract structured data from text using a schema.

Parameters:

  • text (str): Document text (from parse)
  • extraction_schema (dict): Schema defining fields to extract

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.0.tar.gz (3.8 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.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parze-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 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.0.tar.gz
Algorithm Hash digest
SHA256 eb854d354130669ae5bc8d20c215a7d9a69a8d97a96477fa884f66a2a29555a0
MD5 000bca6d5869d0fa83c4d703229f8fe7
BLAKE2b-256 92a4dab8b4a43a14dc605b7a9eb9e1e4d9692fc5ac1048c3733a30785c906036

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parze-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bc093764d77e218dfa75558015b174df702b40518c4a83f010860893b76d7d9
MD5 dd5b927204a3679bdac0fc3d81f75973
BLAKE2b-256 bc490725fcae972bc92c3e208d85da724300fe1e7ce4ed09040d9f53d3f1b799

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