Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Update API, naming, and tests. Move data model to docling-core #107

Merged
merged 16 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ merge_protections:
success_conditions:
- "title ~=
^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\
\\))?:"
\\))?(!)?:"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pip install docling-parse
Convert a PDF (look in the [visualize.py](docling_parse/visualize.py) for a more detailed information)

```python
from docling_parse.document import SegmentedPdfPageLabel
from docling_core.types.doc.page import TextCellUnit
from docling_parse.pdf_parser import DoclingPdfParser, PdfDocument

parser = DoclingPdfParser()
Expand All @@ -78,11 +78,11 @@ pdf_doc: PdfDocument = parser.load(
for page_no, pred_page in pdf_doc.iterate_pages():

# iterate over the word-cells
for word in pred_page.yield_cells(label=SegmentedPdfPageLabel.WORD):
print(word.rect, ": ", word.text)
for word in pred_page.iterate_cells(unit_type=TextCellUnit.WORD):
print(word.rect, ": ", word.text)

# create a PIL image with the char cells
img = pred_page.render(label=SegmentedPdfPageLabel.CHAR)
# create a PIL image with the char cells
img = pred_page.render_as_image(cell_unit=TextCellUnit.CHAR)
img.show()
```

Expand Down
Loading