Metadata-Version: 2.5
Name: pdflite
Version: 0.0.1
Summary: PDF to markdown: layout repair, OCR fallback, and images on disk
Project-URL: Repository, https://github.com/vedicreader/pdflite
Project-URL: Documentation, https://vedicreader.github.io/pdflite/
Author-email: Karthik <karthik.rajgopal@hotmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: document conversion,layout,markdown,nbdev,ocr,pdf
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.10
Requires-Dist: fastcore>=2.2.15
Requires-Dist: pdf-oxide>=0.3.17
Description-Content-Type: text/markdown

# pdflite


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

[`pdf_md`](https://vedicreader.github.io/pdflite/core.html#pdf_md) converts every page with pdf-oxide and fixes four things conversion gets wrong:

- a word broken across lines by a hyphen is rejoined
- a two-column table reflowed into one stream is swapped for the plain-text layer, when that
  strands fewer values
- a scanned page with no text layer goes through OCR
- reader chrome from a print-to-PDF is dropped

``` python
from pdflite import pdf_md

md = pdf_md('pdfs/attention_is_all_you_need.pdf', out_path='out'); md[:100] # out_path stores images
# pages = pdf_md('statement.pdf', out_path='out', pages=True)  # one entry per page
```

    Dictionary used where Stream expected, treating as empty stream
    Dictionary used where Stream expected, treating as empty stream
    Dictionary used where Stream expected, treating as empty stream
    Dictionary used where Stream expected, treating as empty stream

    'Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and'

Each fix is exported on its own: [`clean_md`](https://vedicreader.github.io/pdflite/core.html#clean_md), [`fix_layout`](https://vedicreader.github.io/pdflite/core.html#fix_layout), [`orphan_vals`](https://vedicreader.github.io/pdflite/core.html#orphan_vals),
[`scrambled_layout`](https://vedicreader.github.io/pdflite/core.html#scrambled_layout), [`needs_ocr`](https://vedicreader.github.io/pdflite/core.html#needs_ocr), [`ocr_parse`](https://vedicreader.github.io/pdflite/core.html#ocr_parse), [`oxide_parse`](https://vedicreader.github.io/pdflite/core.html#oxide_parse).

``` python
clean_md('a docu-\nment')      # a hyphen split across lines
```

    'a document'

``` python
orphan_vals('Opening balance\nFees\n1,240.00\n18.50')   # values cut loose from their labels
```

    2

## Install

``` sh
pip install pdflite
```

OCR needs `liteparse`, imported when it runs. No extras: an optional package is imported where it
is used and raises saying what to install.
