def startJob()

in code/textract_async/textract_starter.py [0:0]


def startJob(bucketName, objectName, documentId, snsTopic, snsRole):
    print("Starting job with documentId: {}, bucketName: {}, objectName: {}".format(documentId, bucketName, objectName))

    response = None
    client = AwsHelper().getClient('textract')
    response = client.start_document_analysis(
        ClientRequestToken  = documentId,
        DocumentLocation={
            'S3Object': {
                'Bucket': bucketName,
                'Name': objectName
            }
        },
        FeatureTypes=["FORMS", "TABLES"],
        NotificationChannel= {
              "RoleArn": snsRole,
              "SNSTopicArn": snsTopic
        },
        OutputConfig = {
            "S3Bucket": targetBucketName,
            "S3Prefix": objectName + "/textract-output"
        },
        JobTag = documentId
    )
    return response["JobId"]