Skip to main content

Petey — The Easy PDF Extractor

Project description

Petey

The Easy PDF Extractor.

pip install petey

Setup

Add your API key to a .env file:

OPENAI_API_KEY=sk-...

Or for Anthropic:

ANTHROPIC_API_KEY=sk-ant-...

Usage

petey extract --schema schema.yaml ./pdfs/ -o results.csv

Options: --model/-m (default: gpt-4.1-mini), --concurrency/-c (default: 10), --format/-f (csv/json/jsonl), --output/-o, --instructions/-i.

Schema

name: Invoice
fields:
  vendor:
    type: string
    description: Company name on the invoice
  amount:
    type: number
    description: Total amount due
  date:
    type: date
    description: Invoice date
  status:
    type: enum
    values: [Paid, Unpaid, Overdue]
    description: Payment status

Field types: string, number, date, enum (with or without values), array (with nested fields).

All fields are nullable — the LLM returns null for anything it can't find.

Set record_type: array at the top level for table extraction (multiple records per document).

Add instructions at the top level to append guidance to the system prompt.

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

petey-0.1.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

petey-0.1.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file petey-0.1.2.tar.gz.

File metadata

  • Download URL: petey-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for petey-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6711b7ef398781b3690654cd9bce7739f6c02c1faab0a04edd40c614d4cab56a
MD5 b952ede7b882ae438f9701fd29006fd6
BLAKE2b-256 9062f90eedf5a0742ef2de93cf5f07d81e1f37df87cf34f45d9fb875a3a2ea54

See more details on using hashes here.

File details

Details for the file petey-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: petey-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for petey-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 39a0a276bf4b0535c1e94d93791af06f001d4add900159a4005174a32f1f71d9
MD5 05134e4a123473b42f105eb55664e973
BLAKE2b-256 8483cf814e112249756744c0c619f2f1445a727f98b9d30eb13ae7dff5fd553e

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