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.

Hosted API

AsyncJobClient submits large documents to the hosted API as asynchronous jobs. API keys are issued at https://ai.artifact-network.org. The default endpoint is https://ai-api.artifact-network.org; pass a different base URL to use your own deployment.

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.5.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.5.0
File Size Uploaded Provenance
ag_docparse-0.5.0.tar.gz 8.9 kB With provenance Details

Built distribution (wheel)

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

Total release size: 20.7 kB

Release files / ag_docparse-0.5.0.tar.gz

Download URL ag_docparse-0.5.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5fbfb12e1c02f020da225f8484d8982075b5f742123dd2a9d2f94b9b222105d7
BLAKE2b-256 checksum
How to use checksums
5444f535e035d8c379d64223748dd5107d9a9130aed577b3c926d723e154db50
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 25, 2026.

Transparency log

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

Download URL ag_docparse-0.5.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7668ef775d6f1d8da94e664ef1b73a4add56b96593c07b51efcbc20d98710a1e
BLAKE2b-256 checksum
How to use checksums
1ce1a68d35c6fc6f23fd99391f273085c8f1eec3c75afeeb745ba074cd5eb346
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 25, 2026.

Transparency log

Security for ag-docparse 0.5.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.5.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 25, 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.5.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