'S3' object has no attribute 'detect_document_text' (python code)


'S3' object has no attribute 'detect_document_text' this error show when try to extract raw text data from invoice document using AWS Textract python function detect_document_text inside AWS Lambda.

asked a year ago526 views
1 Answer

Sounds like you're doing something like this:

s3 = boto3.client("s3")
# maybe some other code here

But you need to create a textract client:

textract = boto3.client("textract")
# maybe some other code here
response = textract.detect_document_text(
        "S3Object": { "Bucket": "mybucketname", "Name": "my-object-name.jpg" }

Check out the boto3 documentation for textract, and for detect_document_text() specifically for more info, including the value of the response you'll get back.

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions