This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \ | |
$(aws sts assume-role \ | |
--role-arn arn:aws:iam::123456789012:role/MyAssumedRole \ | |
--role-session-name MySessionName \ | |
--query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" \ | |
--output text)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
from textract import get_textract_info, print_kvs | |
if __name__ == "__main__": | |
document_name = "pdf_with_text.pdf" | |
#### call textract | |
lines, kvs, tables_rows = get_textract_info(document_name) | |
print("\n\n== FOUND KEY : VALUE pairs ===\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import email | |
import boto3 | |
from PyPDF2 import PdfFileReader, PdfFileWriter # not native library | |
def lambda_handler(event, context): | |
print(f"event: {event}") | |
workmail = boto3.client('workmailmessageflow', region_name=os.environ["AWS_REGION"]) |