Skip to main content

Extract structured data from invoices, receipts, and documents. PDF/image in, JSON out.

Project description

aPapyr Python SDK

Extract structured data from invoices, receipts, and documents. Send a PDF or image, get clean JSON back.

Install

pip install apapyr

Quick Start

from apapyr import aPapyr

client = aPapyr("sk_live_your_key")

# Extract data from an invoice
result = client.extract("invoice.pdf")

print(result.get_field("vendor_name"))   # "Acme Corp"
print(result.get_field("total"))          # 1250.00
print(result.get_field("due_date"))       # "2026-04-15"
print(result.confidence)                  # 0.97

# Get all fields as a flat dictionary
print(result.to_flat_dict())
# {"document_type": "invoice", "vendor_name": "Acme Corp", "total": 1250.00, ...}

# Check confidence for a specific field
print(result.get_field_confidence("total"))  # 0.98

Document Types

Type Key Fields
invoice vendor, total, tax, due_date, line_items
receipt merchant, total, tax, tip, payment_method
w2 employer, wages, federal_tax, state_tax
bank_statement bank, balances, transactions
contract parties, dates, value, obligations
auto automatically detects type (default)

AI Agent Support

aPapyr works natively with AI agents via MCP:

# Add to Claude Code
claude mcp add apapyr -- npx @apapyr/mcp-server

Then just ask: "Extract the data from invoice.pdf"

Environment Variable

export APAPYR_API_KEY=sk_live_your_key
client = aPapyr()  # reads from env

Links

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

apapyr-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

apapyr-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file apapyr-1.0.0.tar.gz.

File metadata

  • Download URL: apapyr-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.6

File hashes

Hashes for apapyr-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d2a9e02069223f40c348996e4869feda0bc20b218240f1832419d5176aa42e5d
MD5 e2cd36a4be928a433a05364a7a579173
BLAKE2b-256 f93a28f14c32eb129faf5aeef2b49022aceee3e3a566b30835801d8e0ec4f57a

See more details on using hashes here.

File details

Details for the file apapyr-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: apapyr-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.6

File hashes

Hashes for apapyr-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68bcac8a2181eb72907596383acc3c37d4f2f0ee8260dfe6f20f6f6d69227ff3
MD5 baf95a5c1dc244433971c6c8845109dc
BLAKE2b-256 5ce3dc85f3c16a0251f1fe07143badf1fc7c524ae7a4e5bbc3e7fd48e8537eb9

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