Пакет для разбивки различных документов (docx, pdf, изображения) на страницы, блоки, строки и слова
Project description
Document Parser
Пакет для разбивки документов на страницы, блоки, строки и слова.
Поддерживаемые форматы документов:
- DOCX, DOC, RTF, ODT, DOT, DOTX
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad5a210787b1196816118a0c4a9d2113719e8eb391ee2e7aa8b421209e9d4e02
|
|
| MD5 |
0e56dfa4f43a84736a91408d89dc6274
|
|
| BLAKE2b-256 |
5cfc3d14fc30d6ae882272d4db4d548a22c7563c3801e47247ac13e9eed1161f
|
Provenance
The following attestation bundles were made for doc_layout_parser-2.5.6.tar.gz:
Publisher:
publish.yml on i1mk8/DocumentParser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doc_layout_parser-2.5.6.tar.gz -
Subject digest:
ad5a210787b1196816118a0c4a9d2113719e8eb391ee2e7aa8b421209e9d4e02 - Sigstore transparency entry: 844577457
- Sigstore integration time:
-
Permalink:
i1mk8/DocumentParser@90a19cfa48abbacfec1d7f0b4d6ca37016b1ef8b -
Branch / Tag:
refs/tags/v2.5.6 - Owner: https://github.com/i1mk8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@90a19cfa48abbacfec1d7f0b4d6ca37016b1ef8b -
Trigger Event:
release
-
Statement type:
File details
Details for the file doc_layout_parser-2.5.6-py3-none-any.whl.
File metadata
- Download URL: doc_layout_parser-2.5.6-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb8013e0f14afe567a0be16476626411f68fedddd20452e44c6c76d64877a528
|
|
| MD5 |
7a439a3810808312cec19d2f3b628a2f
|
|
| BLAKE2b-256 |
afbaaa6d8f2ce523dc535efcabe3d614caeff34500e59de4a516c2248d3bcb0b
|
Provenance
The following attestation bundles were made for doc_layout_parser-2.5.6-py3-none-any.whl:
Publisher:
publish.yml on i1mk8/DocumentParser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doc_layout_parser-2.5.6-py3-none-any.whl -
Subject digest:
fb8013e0f14afe567a0be16476626411f68fedddd20452e44c6c76d64877a528 - Sigstore transparency entry: 844577458
- Sigstore integration time:
-
Permalink:
i1mk8/DocumentParser@90a19cfa48abbacfec1d7f0b4d6ca37016b1ef8b -
Branch / Tag:
refs/tags/v2.5.6 - Owner: https://github.com/i1mk8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@90a19cfa48abbacfec1d7f0b4d6ca37016b1ef8b -
Trigger Event:
release
-
Statement type: