AskRedaction
The redaction functionality in Werk24 allows users to request automated redaction of specific areas within a technical drawing. This includes the removal of logos, company data, personal data, and keywords.
Important
The Redaction returns both, the redacated drawing, as well as a list of regions that were redacted. This allow you to implement your own validation system.
Request
AskRedaction represents the request to redact specified content from a technical drawing. This includes options for redacting logos, company and personal data, specific keywords, and customizing the output format and appearance of the redacted areas.
Attributes
Bases: AskV2
A class that represents a request for redaction from the server.
| PARAMETER | DESCRIPTION |
|---|---|
ask_version | TYPE: |
ask_type | TYPE: |
redact_logos | Whether to redact logos from the drawing. TYPE: |
redact_company_data | Whether to redact company data. TYPE: |
redact_personal_data | Whether to redact personal data. TYPE: |
redact_keywords | A list of keywords to redact from the drawing. Keywords are specified as strings. TYPE: |
output_format | The desired output format for the redacted drawing TYPE: |
fill_color | The fill color for the redacted areas. If None, only the polygon outlines for redacted areas are returned, and the user can perform the redaction themselves. TYPE: |
Source code in werk24/models/v2/asks.py
Example Usage
from werk24 import AskRedaction, RedactionKeyword, read_example_drawing
# Create an AskRedaction object with custom settings
ask = AskRedaction(
redact_logos=True,
redact_company_data=True,
redact_personal_data=False,
redact_keywords=[RedactionKeyword(keyword="confidential"), RedactionKeyword(keyword="draft")],
output_format="PDF",
fill_color="#ffffff"
)
# Send the redaction request
response = read_example_drawing([ask])
# Print the redaction.
print(response["ASK_REDACTION"][0].payload_dict)
Binary Response
You can obtain the binary reponse by accessing the attribute payload_bytes.
Note
If you implement your own client, you need to perform the downloading and decryption of the payload yourself. You can obtain the download your by accessing the attribute payload_url.
Dictionary Response
ResponseRedaction represents the server's response to a redaction request. It contains the list of redaction zones which define the areas in the drawing that have been redacted.
Attributes
- redaction_zones (List[RedactionZone]): A list of redacted areas in the drawing. Each redacted area is represented by a RedactionZone object containing information about the coordinates and shape of the redacted area.