Skip to main content

Semantic PDF-to-Markdown engine for Arabic and bilingual texts with local routing and repair

Project description

versed

Local PDF-to-Markdown tooling for Arabic and bilingual texts.

It repairs broken extraction, decodes QCF Quran fonts, classifies pages, and renders semantic Markdown from local PDFs. It also normalizes parsed OpenITI block JSON into the same public Document and markdown/plain-text outputs.

Install

pip install versed-pdf
pip install versed-pdf[pdf]
pip install versed-pdf[pdf,ocr]

Quick start

from versed import extract_document

result = extract_document("book.pdf", title="Book")
print(result.markdown)

OpenITI normalization:

from versed import build_openiti_markdown

parsed = {
    "metadata": {"title": "رسالة"},
    "content": [
        {"type": "title", "content": "رسالة"},
        {"type": "pageNumber", "content": {"volume": "01", "page": "218"}},
        {"type": "paragraph", "content": "قال المصنف ..."},
    ],
}

result = build_openiti_markdown(parsed)
print(result.markdown)

CLI

versed repair-text "taf߬l"
versed detect book.pdf
versed classify book.pdf
versed extract book.pdf -o book.md

Public modules

  • versed.repair: Sabon mojibake repair helpers
  • versed.qcf: QCF Quran font decoding
  • versed.classify: local page classification and backend selection
  • versed.routing: cost-aware routing heuristics
  • versed.layout: aligned words to semantic blocks
  • versed.markdown: semantic blocks to Markdown/plain text
  • versed.openiti: parsed OpenITI block JSON to Document and markdown
  • versed.extract: end-to-end local extraction

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

versed_pdf-1.2.0.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

versed_pdf-1.2.0-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file versed_pdf-1.2.0.tar.gz.

File metadata

  • Download URL: versed_pdf-1.2.0.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for versed_pdf-1.2.0.tar.gz
Algorithm Hash digest
SHA256 57222fa9b9aeeba0e209c29f5f0b23e3f6bce890f07725d07d058848cf7849a4
MD5 b4948e6e78ded518a9f9b7d376735b15
BLAKE2b-256 5fe8e58ac6be9ea4846f13f0de2018b72b64a817f7bc663de9709bac70f458a8

See more details on using hashes here.

File details

Details for the file versed_pdf-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: versed_pdf-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for versed_pdf-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b15a19f59dfef969dbfb506a393f182d9346fafcbbf8d7505074cde8c92bba1d
MD5 a27ea43219b2158384e02440a29aeb9f
BLAKE2b-256 399d3706f940c8c942d0eca187846387de95ca1a2b8767fa36a1c66eb1582f3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page