Skip to main content

knowledge-extractor-ai

Read any PDF and preserve its document structure — headings, paragraphs, tables, lists, key-value pairs, checkboxes, reading order and bounding boxes — as clean JSON, instead of flattening it to plain text.

Powered by Docling for layout analysis.

Install

pip install knowledge-extractor-ai

Usage

Python

from knowledgeextract.pdf import extract_pdf

doc = extract_pdf("myfile.pdf")
doc.to_json("result.json")        # write structured JSON
print(doc.markdown)               # Markdown view

Command line

pdf-extract extract myfile.pdf -o result.json -m result.md

The first run downloads/loads Docling's layout models and may take a few minutes; subsequent runs are fast.

What gets extracted

Field Notes
Headings with level
Paragraphs body text blocks
Tables rows + dimensions
Lists items grouped, ordered/unordered
Checkboxes checked state + label
Key-value pairs label/value regions
Images reference + bounding box (no bytes)
Bounding boxes on every element (PDF points, top-left origin)
Reading order document-wide ordering
Markdown rendered view of the whole document

Output shape

{
  "metadata": { "filename": "myfile.pdf", "page_count": 1, "engine": "docling" },
  "pages": [
    {
      "page_number": 1,
      "width": 612.0,
      "height": 792.0,
      "elements": [
        { "type": "heading", "order": 0, "page_number": 1, "level": 1,
          "bbox": { "x0": 78.0, "y0": 111.0, "x1": 178.0, "y1": 127.7 },
          "text": "1. Overview" }
      ]
    }
  ],
  "reading_order": [0, 1, 2],
  "markdown": "## 1. Overview\n..."
}

Project layout

Each file format is a self-contained subpackage. PDF ships today; Word, Excel and others plug in alongside it.

knowledgeextract/
└── pdf/
    ├── converter.py   # Docling wrapper
    ├── normalize.py   # Docling -> schema
    ├── models.py      # JSON schema (Pydantic)
    └── cli.py         # pdf-extract command

License

See LICENSE.

Metadata

Release files for knowledge-extractor-ai 0.1.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 knowledge-extractor-ai 0.1.0
File Size Uploaded Provenance Actions
knowledge_extractor_ai-0.1.0.tar.gz 14.8 kB Without provenance Details for knowledge_extractor_ai-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for knowledge-extractor-ai 0.1.0
File Interpreter ABI Platform Actions
knowledge_extractor_ai-0.1.0-py3-none-any.whl Python 3 none any Details for knowledge_extractor_ai-0.1.0-py3-none-any.whl

Total release size: 32.2 kB

Release files / knowledge_extractor_ai-0.1.0.tar.gz

Download URL knowledge_extractor_ai-0.1.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
39bb4fbbe61213bbc4e849c7f409880525224ea9f3f0e5a8b7168729bded54cb
BLAKE2b-256 checksum
How to use checksums
76d156fa48f2d505868a22700b2259e2c3aa6a5fb1f22fc03b67be6d651659a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / knowledge_extractor_ai-0.1.0-py3-none-any.whl

Download URL knowledge_extractor_ai-0.1.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1e0fc2586a05078bddfbdd07b7f6a91d97e47810a38c4d330cba5b3a9c89257
BLAKE2b-256 checksum
How to use checksums
b53ee2eb67fc8e96c4978c9e11c6f5644a61afbcf93c46a593fb33d140c0c033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Security for knowledge-extractor-ai 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.0 This release

2 release files No 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