Textract / Client / update_project

update_project

Textract.Client.update_project(**kwargs)

Updates the configuration of an existing project. If you omit a configuration, UpdateProject leaves it unchanged. A configuration that you supply replaces the stored one, so include every setting that you want to keep.

See also: AWS API Documentation

Request Syntax

response = client.update_project(
    ProjectArn='string',
    ProjectDescription='string',
    ExtractionConfiguration={
        'BoundingBox': {
            'State': 'ENABLED'|'DISABLED'
        },
        'Granularity': {
            'Types': [
                'DOCUMENT'|'PAGE'|'ELEMENT'|'WORD'|'LINE',
            ]
        },
        'OutputFormat': {
            'AdditionalFileFormat': {
                'State': 'ENABLED'|'DISABLED'
            },
            'TextFormat': {
                'Types': [
                    'PLAIN_TEXT'|'MARKDOWN'|'HTML'|'CSV',
                ]
            }
        }
    },
    GenerativeConfiguration={
        'Summarization': {
            'State': 'ENABLED'|'DISABLED'
        },
        'FigureCaption': {
            'State': 'ENABLED'|'DISABLED'
        }
    },
    CustomConfiguration={
        'Blueprints': [
            {
                'BlueprintArn': 'string',
                'BlueprintVersion': 'string'
            },
        ],
        'FallbackBlueprints': [
            {
                'BlueprintArn': 'string',
                'BlueprintVersion': 'string'
            },
        ]
    },
    SplitterConfiguration={
        'State': 'ENABLED'|'DISABLED'
    },
    SensitiveDataConfiguration={
        'DetectionMode': 'DETECTION'|'DETECTION_AND_REDACTION'|'DISABLED',
        'PiiEntitiesConfiguration': {
            'PiiEntityTypes': [
                'ALL'|'ADDRESS'|'AGE'|'NAME'|'EMAIL'|'PHONE'|'USERNAME'|'PASSWORD'|'DRIVER_ID'|'LICENSE_PLATE'|'VEHICLE_IDENTIFICATION_NUMBER'|'CREDIT_DEBIT_CARD_CVV'|'CREDIT_DEBIT_CARD_EXPIRY'|'CREDIT_DEBIT_CARD_NUMBER'|'PIN'|'INTERNATIONAL_BANK_ACCOUNT_NUMBER'|'SWIFT_CODE'|'IP_ADDRESS'|'MAC_ADDRESS'|'URL'|'AWS_ACCESS_KEY'|'AWS_SECRET_KEY'|'US_BANK_ACCOUNT_NUMBER'|'US_BANK_ROUTING_NUMBER'|'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER'|'US_PASSPORT_NUMBER'|'US_SOCIAL_SECURITY_NUMBER'|'CA_HEALTH_NUMBER'|'CA_SOCIAL_INSURANCE_NUMBER'|'UK_NATIONAL_HEALTH_SERVICE_NUMBER'|'UK_NATIONAL_INSURANCE_NUMBER'|'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER',
            ],
            'RedactionMaskMode': 'PII'|'ENTITY_TYPE'
        }
    },
    EncryptionConfiguration={
        'KmsKeyId': 'string',
        'KmsEncryptionContext': {
            'string': 'string'
        }
    }
)
Parameters:
  • ProjectArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the project to update.

  • ProjectDescription (string) – The updated description of the project.

  • ExtractionConfiguration (dict) –

    The configuration that controls how Amazon Textract extracts content from the document, including bounding boxes, granularity, and output format. Replaces the stored extraction configuration.

    • BoundingBox (dict) – [REQUIRED]

      Controls whether bounding box geometry is included in the extraction output.

      • State (string) – [REQUIRED]

        Set to ENABLED to return bounding box geometry, or DISABLED to omit it.

    • Granularity (dict) – [REQUIRED]

      Controls the granularity levels at which content is extracted.

      • Types (list) –

        The granularity levels at which Amazon Textract extracts content, from the whole document down to individual lines of text. Each type can appear only once.

        • (string) –

    • OutputFormat (dict) – [REQUIRED]

      Controls the format of the extraction output.

      • AdditionalFileFormat (dict) – [REQUIRED]

        Controls whether an additional file format is produced alongside the primary output.

        • State (string) – [REQUIRED]

          Set to ENABLED to produce an additional file format, or DISABLED to omit it.

      • TextFormat (dict) – [REQUIRED]

        Controls the text formats produced in the extraction output.

        • Types (list) –

          The text formats produced in the extraction output. Each type can appear only once, and CSV can’t be the only type.

          • (string) –

  • GenerativeConfiguration (dict) –

    The configuration that controls generative capabilities such as summarization and figure captioning. Replaces the stored generative configuration, so a capability that you omit is turned off.

    • Summarization (dict) –

      Controls whether a generative summary of the document is produced. If you omit it, no summary is produced.

      • State (string) – [REQUIRED]

        Set to ENABLED to produce a summary, or DISABLED to omit it.

    • FigureCaption (dict) –

      Controls whether generative captions are produced for figures detected in the document. If you omit it, no figure captions are produced.

      • State (string) – [REQUIRED]

        Set to ENABLED to produce figure captions, or DISABLED to omit them.

  • CustomConfiguration (dict) –

    The configuration that associates blueprints with the project for custom output extraction. Replaces the stored custom configuration. To disable custom configuration, specify an empty Blueprints list.

    • Blueprints (list) – [REQUIRED]

      The blueprints used to extract custom structured output.

      • (dict) –

        Associates a blueprint, and optionally a specific blueprint version, with a project for custom output extraction.

        • BlueprintArn (string) – [REQUIRED]

          The Amazon Resource Name (ARN) of the blueprint.

        • BlueprintVersion (string) –

          The version of the blueprint. If omitted, the latest version is used.

    • FallbackBlueprints (list) –

      The blueprint used when a document does not match any of the primary blueprints. Requires at least one blueprint in Blueprints.

      • (dict) –

        Associates a blueprint, and optionally a specific blueprint version, with a project for custom output extraction.

        • BlueprintArn (string) – [REQUIRED]

          The Amazon Resource Name (ARN) of the blueprint.

        • BlueprintVersion (string) –

          The version of the blueprint. If omitted, the latest version is used.

  • SplitterConfiguration (dict) –

    The configuration that controls whether multi-document packets are split into individual documents. Replaces the stored splitter configuration.

    • State (string) – [REQUIRED]

      Set to ENABLED to split multi-document packets, or DISABLED to treat the input as a single document.

  • SensitiveDataConfiguration (dict) –

    The configuration that controls detection and redaction of sensitive data, such as personally identifiable information (PII). Replaces the stored sensitive data configuration. To turn off detection, set DetectionMode to DISABLED.

    • DetectionMode (string) – [REQUIRED]

      The detection mode. Valid values:

      • DETECTION - Only detects sensitive data.

      • DETECTION_AND_REDACTION - Detects and redacts sensitive data in the output.

      • DISABLED - Does not detect sensitive data.

    • PiiEntitiesConfiguration (dict) –

      The configuration that specifies which PII entity types to detect and how to mask them. If you omit it, Amazon Textract detects all PII entity types ( ALL) and masks them with ENTITY_TYPE.

      • PiiEntityTypes (list) – [REQUIRED]

        The list of PII entity types to detect. Each type can appear only once.

        • (string) –

      • RedactionMaskMode (string) – [REQUIRED]

        How detected PII is masked in the redacted output.

  • EncryptionConfiguration (dict) –

    The AWS KMS encryption configuration used to encrypt the project at rest.

    • KmsKeyId (string) – [REQUIRED]

      The identifier of the AWS KMS key to use for encryption. This can be a key ID, key ARN, alias name, or alias ARN.

    • KmsEncryptionContext (dict) –

      A set of key-value pairs that Amazon Textract includes as the AWS KMS encryption context when encrypting and decrypting the resource.

      On UpdateProject and UpdateBlueprint, this member is the one exception to replacing a supplied configuration whole. If you omit it, the stored encryption context is kept. To clear a custom encryption context, specify an empty map ( {}).

      • (string) –

        • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'ProjectArn': 'string',
    'Status': 'COMPLETED'|'FAILED'
}

Response Structure

  • (dict) –

    • ProjectArn (string) –

      The Amazon Resource Name (ARN) of the project that was updated.

    • Status (string) –

      The status of the project after the update.

Exceptions

  • Textract.Client.exceptions.ResourceNotFoundException

  • Textract.Client.exceptions.InvalidParameterException

  • Textract.Client.exceptions.ValidationException

  • Textract.Client.exceptions.ConflictException

  • Textract.Client.exceptions.AccessDeniedException

  • Textract.Client.exceptions.LimitExceededException

  • Textract.Client.exceptions.ProvisionedThroughputExceededException

  • Textract.Client.exceptions.InternalServerError