Skip to content

TextractClient

Index > Textract > TextractClient

Auto-generated documentation for Textract type annotations stubs module mypy-boto3-textract.

TextractClient

Type annotations and code completion for boto3.client("textract"). boto3 documentation

Usage example
from boto3.session import Session
from mypy_boto3_textract.client import TextractClient

def get_textract_client() -> TextractClient:
    return Session().client("textract")

Exceptions

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("textract").exceptions structure.

Usage example
client = boto3.client("textract")

try:
    do_something(client)
except (
    client.AccessDeniedException,
    client.BadDocumentException,
    client.ClientError,
    client.DocumentTooLargeException,
    client.HumanLoopQuotaExceededException,
    client.IdempotentParameterMismatchException,
    client.InternalServerError,
    client.InvalidJobIdException,
    client.InvalidKMSKeyException,
    client.InvalidParameterException,
    client.InvalidS3ObjectException,
    client.LimitExceededException,
    client.ProvisionedThroughputExceededException,
    client.ThrottlingException,
    client.UnsupportedDocumentException,
) as e:
    print(e)
Type checking example
from mypy_boto3_textract.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods

analyze_document

Analyzes an input document for relationships between detected items.

Type annotations and code completion for boto3.client("textract").analyze_document method. boto3 documentation

Method definition
def analyze_document(
    self,
    *,
    Document: DocumentTypeDef,  # (1)
    FeatureTypes: Sequence[FeatureTypeType],  # (2)
    HumanLoopConfig: HumanLoopConfigTypeDef = ...,  # (3)
    QueriesConfig: QueriesConfigTypeDef = ...,  # (4)
) -> AnalyzeDocumentResponseTypeDef:  # (5)
    ...
  1. See DocumentTypeDef
  2. See FeatureTypeType
  3. See HumanLoopConfigTypeDef
  4. See QueriesConfigTypeDef
  5. See AnalyzeDocumentResponseTypeDef
Usage example with kwargs
kwargs: AnalyzeDocumentRequestRequestTypeDef = {  # (1)
    "Document": ...,
    "FeatureTypes": ...,
}

parent.analyze_document(**kwargs)
  1. See AnalyzeDocumentRequestRequestTypeDef

analyze_expense

AnalyzeExpense synchronously analyzes an input document for financially related relationships between text.

Type annotations and code completion for boto3.client("textract").analyze_expense method. boto3 documentation

Method definition
def analyze_expense(
    self,
    *,
    Document: DocumentTypeDef,  # (1)
) -> AnalyzeExpenseResponseTypeDef:  # (2)
    ...
  1. See DocumentTypeDef
  2. See AnalyzeExpenseResponseTypeDef
Usage example with kwargs
kwargs: AnalyzeExpenseRequestRequestTypeDef = {  # (1)
    "Document": ...,
}

parent.analyze_expense(**kwargs)
  1. See AnalyzeExpenseRequestRequestTypeDef

analyze_id

Analyzes identity documents for relevant information.

Type annotations and code completion for boto3.client("textract").analyze_id method. boto3 documentation

Method definition
def analyze_id(
    self,
    *,
    DocumentPages: Sequence[DocumentTypeDef],  # (1)
) -> AnalyzeIDResponseTypeDef:  # (2)
    ...
  1. See DocumentTypeDef
  2. See AnalyzeIDResponseTypeDef
Usage example with kwargs
kwargs: AnalyzeIDRequestRequestTypeDef = {  # (1)
    "DocumentPages": ...,
}

parent.analyze_id(**kwargs)
  1. See AnalyzeIDRequestRequestTypeDef

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("textract").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("textract").close method. boto3 documentation

Method definition
def close(
    self,
) -> None:
    ...

detect_document_text

Detects text in the input document.

Type annotations and code completion for boto3.client("textract").detect_document_text method. boto3 documentation

Method definition
def detect_document_text(
    self,
    *,
    Document: DocumentTypeDef,  # (1)
) -> DetectDocumentTextResponseTypeDef:  # (2)
    ...
  1. See DocumentTypeDef
  2. See DetectDocumentTextResponseTypeDef
Usage example with kwargs
kwargs: DetectDocumentTextRequestRequestTypeDef = {  # (1)
    "Document": ...,
}

parent.detect_document_text(**kwargs)
  1. See DetectDocumentTextRequestRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("textract").generate_presigned_url method. boto3 documentation

Method definition
def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_document_analysis

Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document.

Type annotations and code completion for boto3.client("textract").get_document_analysis method. boto3 documentation

Method definition
def get_document_analysis(
    self,
    *,
    JobId: str,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetDocumentAnalysisResponseTypeDef:  # (1)
    ...
  1. See GetDocumentAnalysisResponseTypeDef
Usage example with kwargs
kwargs: GetDocumentAnalysisRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.get_document_analysis(**kwargs)
  1. See GetDocumentAnalysisRequestRequestTypeDef

get_document_text_detection

Gets the results for an Amazon Textract asynchronous operation that detects text in a document.

Type annotations and code completion for boto3.client("textract").get_document_text_detection method. boto3 documentation

Method definition
def get_document_text_detection(
    self,
    *,
    JobId: str,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetDocumentTextDetectionResponseTypeDef:  # (1)
    ...
  1. See GetDocumentTextDetectionResponseTypeDef
Usage example with kwargs
kwargs: GetDocumentTextDetectionRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.get_document_text_detection(**kwargs)
  1. See GetDocumentTextDetectionRequestRequestTypeDef

get_expense_analysis

Gets the results for an Amazon Textract asynchronous operation that analyzes invoices and receipts.

Type annotations and code completion for boto3.client("textract").get_expense_analysis method. boto3 documentation

Method definition
def get_expense_analysis(
    self,
    *,
    JobId: str,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetExpenseAnalysisResponseTypeDef:  # (1)
    ...
  1. See GetExpenseAnalysisResponseTypeDef
Usage example with kwargs
kwargs: GetExpenseAnalysisRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.get_expense_analysis(**kwargs)
  1. See GetExpenseAnalysisRequestRequestTypeDef

get_lending_analysis

Gets the results for an Amazon Textract asynchronous operation that analyzes text in a lending document.

Type annotations and code completion for boto3.client("textract").get_lending_analysis method. boto3 documentation

Method definition
def get_lending_analysis(
    self,
    *,
    JobId: str,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetLendingAnalysisResponseTypeDef:  # (1)
    ...
  1. See GetLendingAnalysisResponseTypeDef
Usage example with kwargs
kwargs: GetLendingAnalysisRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.get_lending_analysis(**kwargs)
  1. See GetLendingAnalysisRequestRequestTypeDef

get_lending_analysis_summary

Gets summarized results for the StartLendingAnalysis operation, which analyzes text in a lending document.

Type annotations and code completion for boto3.client("textract").get_lending_analysis_summary method. boto3 documentation

Method definition
def get_lending_analysis_summary(
    self,
    *,
    JobId: str,
) -> GetLendingAnalysisSummaryResponseTypeDef:  # (1)
    ...
  1. See GetLendingAnalysisSummaryResponseTypeDef
Usage example with kwargs
kwargs: GetLendingAnalysisSummaryRequestRequestTypeDef = {  # (1)
    "JobId": ...,
}

parent.get_lending_analysis_summary(**kwargs)
  1. See GetLendingAnalysisSummaryRequestRequestTypeDef

start_document_analysis

Starts the asynchronous analysis of an input document for relationships between detected items such as key-value pairs, tables, and selection elements.

Type annotations and code completion for boto3.client("textract").start_document_analysis method. boto3 documentation

Method definition
def start_document_analysis(
    self,
    *,
    DocumentLocation: DocumentLocationTypeDef,  # (1)
    FeatureTypes: Sequence[FeatureTypeType],  # (2)
    ClientRequestToken: str = ...,
    JobTag: str = ...,
    NotificationChannel: NotificationChannelTypeDef = ...,  # (3)
    OutputConfig: OutputConfigTypeDef = ...,  # (4)
    KMSKeyId: str = ...,
    QueriesConfig: QueriesConfigTypeDef = ...,  # (5)
) -> StartDocumentAnalysisResponseTypeDef:  # (6)
    ...
  1. See DocumentLocationTypeDef
  2. See FeatureTypeType
  3. See NotificationChannelTypeDef
  4. See OutputConfigTypeDef
  5. See QueriesConfigTypeDef
  6. See StartDocumentAnalysisResponseTypeDef
Usage example with kwargs
kwargs: StartDocumentAnalysisRequestRequestTypeDef = {  # (1)
    "DocumentLocation": ...,
    "FeatureTypes": ...,
}

parent.start_document_analysis(**kwargs)
  1. See StartDocumentAnalysisRequestRequestTypeDef

start_document_text_detection

Starts the asynchronous detection of text in a document.

Type annotations and code completion for boto3.client("textract").start_document_text_detection method. boto3 documentation

Method definition
def start_document_text_detection(
    self,
    *,
    DocumentLocation: DocumentLocationTypeDef,  # (1)
    ClientRequestToken: str = ...,
    JobTag: str = ...,
    NotificationChannel: NotificationChannelTypeDef = ...,  # (2)
    OutputConfig: OutputConfigTypeDef = ...,  # (3)
    KMSKeyId: str = ...,
) -> StartDocumentTextDetectionResponseTypeDef:  # (4)
    ...
  1. See DocumentLocationTypeDef
  2. See NotificationChannelTypeDef
  3. See OutputConfigTypeDef
  4. See StartDocumentTextDetectionResponseTypeDef
Usage example with kwargs
kwargs: StartDocumentTextDetectionRequestRequestTypeDef = {  # (1)
    "DocumentLocation": ...,
}

parent.start_document_text_detection(**kwargs)
  1. See StartDocumentTextDetectionRequestRequestTypeDef

start_expense_analysis

Starts the asynchronous analysis of invoices or receipts for data like contact information, items purchased, and vendor names.

Type annotations and code completion for boto3.client("textract").start_expense_analysis method. boto3 documentation

Method definition
def start_expense_analysis(
    self,
    *,
    DocumentLocation: DocumentLocationTypeDef,  # (1)
    ClientRequestToken: str = ...,
    JobTag: str = ...,
    NotificationChannel: NotificationChannelTypeDef = ...,  # (2)
    OutputConfig: OutputConfigTypeDef = ...,  # (3)
    KMSKeyId: str = ...,
) -> StartExpenseAnalysisResponseTypeDef:  # (4)
    ...
  1. See DocumentLocationTypeDef
  2. See NotificationChannelTypeDef
  3. See OutputConfigTypeDef
  4. See StartExpenseAnalysisResponseTypeDef
Usage example with kwargs
kwargs: StartExpenseAnalysisRequestRequestTypeDef = {  # (1)
    "DocumentLocation": ...,
}

parent.start_expense_analysis(**kwargs)
  1. See StartExpenseAnalysisRequestRequestTypeDef

start_lending_analysis

Starts the classification and analysis of an input document.

Type annotations and code completion for boto3.client("textract").start_lending_analysis method. boto3 documentation

Method definition
def start_lending_analysis(
    self,
    *,
    DocumentLocation: DocumentLocationTypeDef,  # (1)
    ClientRequestToken: str = ...,
    JobTag: str = ...,
    NotificationChannel: NotificationChannelTypeDef = ...,  # (2)
    OutputConfig: OutputConfigTypeDef = ...,  # (3)
    KMSKeyId: str = ...,
) -> StartLendingAnalysisResponseTypeDef:  # (4)
    ...
  1. See DocumentLocationTypeDef
  2. See NotificationChannelTypeDef
  3. See OutputConfigTypeDef
  4. See StartLendingAnalysisResponseTypeDef
Usage example with kwargs
kwargs: StartLendingAnalysisRequestRequestTypeDef = {  # (1)
    "DocumentLocation": ...,
}

parent.start_lending_analysis(**kwargs)
  1. See StartLendingAnalysisRequestRequestTypeDef