Module page (0.1.1a0)

Wrappers for Document AI Page type.

Classes

Line

Line(
 documentai_line: google.cloud.documentai_v1.types.document.Document.Page.Line,
 text: str,
)

Represents a wrapped documentai.Document.Page.Line.

Page

Page(
 documentai_page: google.cloud.documentai_v1.types.document.Document.Page, text: str
)

Represents a wrapped documentai.Document.Page .

Required. A list of visually detected text lines on the page. A collection of tokens that a human would perceive as a line.

:type: List[str]

Paragraph

Paragraph(
 documentai_paragraph: google.cloud.documentai_v1.types.document.Document.Page.Paragraph,
 text: str,
)

Represents a wrapped documentai.Document.Page.Paragraph.

Table

Table(
 documentai_table: google.cloud.documentai_v1.types.document.Document.Page.Table,
 body_rows: List[List[str]],
 header_rows: List[List[str]],
)

Represents a wrapped documentai.Document.Page.Table.

Modules Functions

_get_lines

_get_lines(
 lines: List[google.cloud.documentai_v1.types.document.Document.Page.Line], text: str
)

Returns a list of Line.

Parameters
Name Description
lines List[documentai.Document.Page.Line]

Required. A list of documentai.Document.Page.Line objects.

text str

Required. UTF-8 encoded text in reading order from the document.

Returns
Type Description
List[Line] A list of Lines.

_get_paragraphs

_get_paragraphs(
 paragraphs: List[google.cloud.documentai_v1.types.document.Document.Page.Paragraph],
 text: str,
)

Returns a list of Paragraph.

Parameters
Name Description
paragraphs List[documentai.Document.Page.Paragraph]

Required. A list of documentai.Document.Page.Paragraph objects.

text str

Required. UTF-8 encoded text in reading order from the document.

Returns
Type Description
List[Paragraph] A list of Paragraphs.

_table_rows_from_documentai_table_rows

_table_rows_from_documentai_table_rows(
 table_rows: List[
 google.cloud.documentai_v1.types.document.Document.Page.Table.TableRow
 ],
 text: str,
)

Returns a list of rows from table_rows.

Parameters
Name Description
table_rows List[documentai.Document.Page.Table.TableRow]

Required. A documentai.Document.Page.Table.TableRow.

text str

Required. UTF-8 encoded text in reading order from the document.

Returns
Type Description
List[str] A list of table rows.

_table_wrapper_from_documentai_table

_table_wrapper_from_documentai_table(
 documentai_table: google.cloud.documentai_v1.types.document.Document.Page.Table,
 text: str,
)

Returns a Table.

Parameters
Name Description
documentai_table documentai.Document.Page.Table

Required. A documentai.Document.Page.Table.

text str

Required. UTF-8 encoded text in reading order from the document.

Returns
Type Description
Table A Table.

_text_from_element_with_layout

_text_from_element_with_layout(
 element_with_layout: Union[
 google.cloud.documentai_v1.types.document.Document.Page.Paragraph,
 google.cloud.documentai_v1.types.document.Document.Page.Line,
 google.cloud.documentai_v1.types.document.Document.Page.Token,
 google.cloud.documentai_v1.types.document.Document.Page.Table.TableCell,
 ],
 text: str,
)

Returns a text from a single element.

Parameters
Name Description
element_with_layout ElementWithLayout

Required. a element with layout attribute.

text str

Required. UTF-8 encoded text in reading order from the document.

Returns
Type Description
str Text from a single element.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.