Skip to main content

ag-docparse

LLM-based structured extraction from documents.

Loads PDF or text documents and extracts typed fields with an LLM, using built-in schemas (invoice, loan application, W-2, NDA, contract) or a custom JSON schema.

Install

pip install "ag-docparse[all]"
npm install ag-docparse

Extras: openai, anthropic, pdf (pdfplumber), all.

Usage

from ag_docparse import INVOICE_SCHEMA, LLMExtractor, from_text

layout = from_text("Invoice INV-001, total due 1,250.00 EUR by 2026-11-30.")
result = LLMExtractor(model="gpt-4o-mini").extract(layout, INVOICE_SCHEMA)  # needs OPENAI_API_KEY
print(result)

Command line: ag-docparse extract -f invoice.pdf -s invoice and ag-docparse schemas.

The TypeScript package ag-docparse is a port of the core classes.

Self-hosted API

AsyncJobClient submits large documents as asynchronous jobs to a self-run ag-platform deployment: AsyncJobClient(api_key=..., base_url=...) (TypeScript: baseUrl). There is no default endpoint.

Development

cd packages/python && pip install -e ".[all]" && pytest
cd packages/typescript && npm ci && npm test

License

MIT, Copyright (c) 2026 Adnan Ghribi.

Metadata

Release files for ag-docparse 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ag-docparse 0.6.0
File Size Uploaded Provenance
ag_docparse-0.6.0.tar.gz 8.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ag-docparse 0.6.0
File Interpreter ABI Platform
ag_docparse-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / ag_docparse-0.6.0.tar.gz

Download URL ag_docparse-0.6.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e789f291c74ad6c5f1210bb209644090e340218d8a30323934fe2b43e2a8892f
BLAKE2b-256 checksum
How to use checksums
9a42f15b2e495a86dabddca48b0855e94aee8090b93f6abac5fbb3fd61162813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / ag_docparse-0.6.0-py3-none-any.whl

Download URL ag_docparse-0.6.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce20c53745072eb2c82cda34e8a11a33bf89e63ad57fd1d4af6615698dd3269f
BLAKE2b-256 checksum
How to use checksums
bd9c82b2a48aad0bbc16ba9c063ca70ed10803b8a881662b9c89fb53e6ab711b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for ag-docparse 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ag_docparse-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page