Skip to content

Block

Source code in docs_src/capo_comprehend/types/block.py
class Block(TypedDict, closed=True):
    id: NotRequired["capo_comprehend.types.string.String"]
    """<p>Unique identifier for the block.</p>"""
    block_type: NotRequired["capo_comprehend.types.block_type.BlockType"]
    """<p>The block represents a line of text or one word of text.</p> <ul> <li> <p>WORD - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.</p> </li> <li> <p>LINE - A string of tab-delimited, contiguous words that are detected on a document page</p> </li> </ul>"""
    text: NotRequired["capo_comprehend.types.string.String"]
    """<p>The word or line of text extracted from the block.</p>"""
    page: NotRequired["capo_comprehend.types.integer.Integer"]
    """<p>Page number where the block appears.</p>"""
    geometry: NotRequired["capo_comprehend.types.geometry.Geometry"]
    """<p>Co-ordinates of the rectangle or polygon that contains the text.</p>"""
    relationships: NotRequired[
        "capo_comprehend.types.list_of_relationships.ListOfRelationships"
    ]
    """<p>A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block that's part of the line of text. </p>"""

block_type instance-attribute

block_type: NotRequired[BlockType]

The block represents a line of text or one word of text.

  • WORD - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.

  • LINE - A string of tab-delimited, contiguous words that are detected on a document page

geometry instance-attribute

geometry: NotRequired[Geometry]

Co-ordinates of the rectangle or polygon that contains the text.

id instance-attribute

id: NotRequired[String]

Unique identifier for the block.

page instance-attribute

page: NotRequired[Integer]

Page number where the block appears.

relationships instance-attribute

relationships: NotRequired[ListOfRelationships]

A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block that's part of the line of text.

text instance-attribute

text: NotRequired[String]

The word or line of text extracted from the block.