Metadata-Version: 2.4
Name: pdf2struct
Version: 0.2.0
Summary: pdf2struct: extract structured JSON from PDFs (text, metadata, tables, OCR, invoice key-value fields).
Author: Kubenew
License: MIT
Project-URL: Homepage, https://github.com/Kubenew/pdf2struct
Project-URL: Repository, https://github.com/Kubenew/pdf2struct
Keywords: pdf,ocr,invoice,parser,extract,table,json
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Text Processing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pdfplumber>=0.11.0
Provides-Extra: ocr
Requires-Dist: pytesseract>=0.3.10; extra == "ocr"
Requires-Dist: Pillow>=10.0.0; extra == "ocr"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Dynamic: license-file

# pdf2struct

`pdf2struct` extracts structured JSON from PDF documents.

Supports:
- text extraction
- metadata extraction
- table extraction
- OCR fallback (optional)
- invoice-like key-value extraction

## Install

```bash
pip install pdf2struct
```

OCR support:

```bash
pip install pdf2struct[ocr]
```

## CLI

Extract PDF:

```bash
pdf2struct input.pdf --out output.json
```

Extract with OCR:

```bash
pdf2struct input.pdf --ocr --out output.json
```

## Output JSON structure

- metadata
- pages (text + tables)
- detected_fields (invoice key-value pairs)

## License
MIT
