Textract / Client / create_project
create_project¶
- Textract.Client.create_project(**kwargs)¶
Creates a project that groups the configuration used to run document insights jobs.
See also: AWS API Documentation
Request Syntax
response = client.create_project( ClientRequestToken='string', ProjectName='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' } }, Tags={ 'string': 'string' } )
- Parameters:
ClientRequestToken (string) –
A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you use the same token for a request that matches a previous request, the service ignores the request, but does not return an error.
This field is autopopulated if not provided.
ProjectName (string) –
[REQUIRED]
A unique name for the project.
ProjectDescription (string) – A description of the project.
ExtractionConfiguration (dict) –
[REQUIRED]
The configuration that controls how Amazon Textract extracts content from the document, including bounding boxes, granularity, and output format.
BoundingBox (dict) – [REQUIRED]
Controls whether bounding box geometry is included in the extraction output.
State (string) – [REQUIRED]
Set to
ENABLEDto return bounding box geometry, orDISABLEDto 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
ENABLEDto produce an additional file format, orDISABLEDto 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
CSVcan’t be the only type.(string) –
GenerativeConfiguration (dict) –
The configuration that controls generative capabilities such as summarization and figure captioning.
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
ENABLEDto produce a summary, orDISABLEDto 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
ENABLEDto produce figure captions, orDISABLEDto omit them.
CustomConfiguration (dict) –
The configuration that associates blueprints with the project for custom output extraction.
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.
State (string) – [REQUIRED]
Set to
ENABLEDto split multi-document packets, orDISABLEDto 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).
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 withENTITY_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. If you don’t specify a value, Amazon Textract encrypts the project using an AWS owned key.
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
UpdateProjectandUpdateBlueprint, 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) –
Tags (dict) –
A set of tags (key-value pairs) to assign to the project.
(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 created.
Status (string) –
The status of the project, indicating whether creation completed successfully or failed.
Exceptions
Textract.Client.exceptions.ResourceNotFoundExceptionTextract.Client.exceptions.InvalidParameterExceptionTextract.Client.exceptions.ValidationExceptionTextract.Client.exceptions.ConflictExceptionTextract.Client.exceptions.AccessDeniedExceptionTextract.Client.exceptions.LimitExceededExceptionTextract.Client.exceptions.ProvisionedThroughputExceededExceptionTextract.Client.exceptions.InternalServerError