Skip to main content

Пакет для разбивки различных документов (docx, pdf, изображения) на страницы, блоки, строки и слова

Project description

Document Parser

Пакет для разбивки документов на страницы, блоки, строки и слова.

Поддерживаемые форматы документов:

  • DOCX, DOC, RTF, ODT, DOT, DOTX
  • PDF
  • PNG, JPG, JPEG, TIFF, BMP, GIF

Установка

Для обработки изображений требуется установить Tesseract

Для обработки документов Microsoft Word требуется установить LibreOffice

Установка с помощью uv (Рекомендуется)

uv add doc-layout-parser

Установка с помощью pip

pip install doc-layout-parser

Использование

>>> from doc_layout_parser import DocumentParser

>>> document_parser = DocumentParser()
>>> result = document_parser.parse('image.png')

>>> result
Document(
    path='image.png',
    source_type='image',
    pages=[Page(
        blocks=[Block(
            lines=[Line(
                words=[Word(
                    word='Пример',
                    bounding_box=BoundingBox(left=28.3, top=32.0, right=36.1, bottom=33.2))]
            )]
        )]
    )]
)

>>> # Результат экспорта в json можно посмотреть в примерах
>>> result.to_json()
...
>>> result.to_dict()
...
>>> result.to_text()
Пример

Примеры

Примеры работы с разными типами документов:

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

doc_layout_parser-2.5.6.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

doc_layout_parser-2.5.6-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file doc_layout_parser-2.5.6.tar.gz.

File metadata

  • Download URL: doc_layout_parser-2.5.6.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for doc_layout_parser-2.5.6.tar.gz
Algorithm Hash digest
SHA256 ad5a210787b1196816118a0c4a9d2113719e8eb391ee2e7aa8b421209e9d4e02
MD5 0e56dfa4f43a84736a91408d89dc6274
BLAKE2b-256 5cfc3d14fc30d6ae882272d4db4d548a22c7563c3801e47247ac13e9eed1161f

See more details on using hashes here.

Provenance

The following attestation bundles were made for doc_layout_parser-2.5.6.tar.gz:

Publisher: publish.yml on i1mk8/DocumentParser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file doc_layout_parser-2.5.6-py3-none-any.whl.

File metadata

File hashes

Hashes for doc_layout_parser-2.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8013e0f14afe567a0be16476626411f68fedddd20452e44c6c76d64877a528
MD5 7a439a3810808312cec19d2f3b628a2f
BLAKE2b-256 afbaaa6d8f2ce523dc535efcabe3d614caeff34500e59de4a516c2248d3bcb0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for doc_layout_parser-2.5.6-py3-none-any.whl:

Publisher: publish.yml on i1mk8/DocumentParser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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