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.
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. |
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.
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. |
Type | Description |
List[Paragraph] | A list of Paragraphs. |
_table_row_from_documentai_table_row
_table_row_from_documentai_table_row(
table_rows: List[
google.cloud.documentai_v1.types.document.Document.Page.Table.TableRow
],
text: str,
)
Returns a list rows from table_rows.
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. |
Type | Description |
List[str] | A list of table rows. |
_table_wrapper_from_documentai_table
_table_wrapper_from_documentai_table(
documentai_table: List[
google.cloud.documentai_v1.types.document.Document.Page.Table
],
text: str,
)
Returns a Table.
Name | Description |
text |
str
Required. UTF-8 encoded text in reading order from the document. |
documentai_tables |
List[documentai.Document.Page.Table]
Required. A list of documentai.Document.Page.Table. |
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.
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. |
Type | Description |
str | Text from a single element. |