Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Tutorials

Focus mode
Tutorials - Amazon Textract

Block objects that are returned from Amazon Textract operations contain the results of text detection and text analysis operations, such as AnalyzeDocument. The following Python tutorials show some of the different ways that you can use Block objects. For example, you can export table information to a comma-separated values (CSV) file.

The tutorials use synchronous Amazon Textract operations that return all results. If you want to use asynchronous operations such as StartDocumentAnalysis, you need to change the example code to accommodate multiple batches of returned Block objects. To make use of the asynchronous operations example, ensure that you have followed the instructions given at Configuring Amazon Textract for Asynchronous Operations.

For examples that show you other ways to use Amazon Textract, see Additional Code Samples.

Prerequisites

Before you can run the examples in this section, you have to configure your environment.

To configure your environment
  1. Give a user the AmazonTextractFullAccess permissions. For more information, see Step 1: Set Up an AWS Account and Create a User.

  2. Install and configure the AWS CLI and the AWS SDKs. For more information, see Step 2: Set Up the AWS CLI and AWS SDKs.

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.