Skip to main content

Redact | Python SDK

The Pangea Redact API helps developers limit the sprawl of sensitive information by performing redaction using defined rules.

download-file

Redact.download_file()

Response Object

Poll result

Redact.poll_result(exception)

Returns request's result that has been accepted by the server

required parameters

AcceptedRequestException

Exception raise by SDK on the call that is been processed.

Response Object

PangeaResponse

response = service.poll_result(exception)

Redact

Redact.redact(text, debug, rules, rulesets, return_result)

Redact sensitive information from provided text.

required parameters

str

The text data to redact

optional parameters

bool

Setting this value to true will provide a detailed analysis of the redacted data and the rules that caused redaction

list[str]

An array of redact rule short names

list[str]

An array of redact rulesets short names

bool

Setting this value to false will omit the redacted result only returning count

Response Object

Pangea Response with redacted text in the response.result property, available response fields can be found in our API Documentation.

response = redact.redact(text="Jenny Jenny... 555-867-5309")

Redact structured

Redact.redact_structured(data, jsonp, format, debug, rules, rulesets, return_result)

Redact sensitive information from structured data (e.g., JSON).

required parameters

dict, str

Structured data to redact

list[str]

JSON path(s) used to identify the specific JSON fields to redact in the structured data. Note: If jsonp parameter is used, the data parameter must be in JSON format.

optional parameters

RedactFormat

The format of the passed data. Default: "json"

bool

Setting this value to true will provide a detailed analysis of the redacted data and the rules that caused redaction

list[str]

An array of redact rule short names

list[str]

An array of redact rulesets short names

bool

Setting this value to false will omit the redacted result only returning count

Response Object

Pangea Response with redacted data in the response.result field, available response fields can be found in our API Documentation

data = {
    "number": "555-867-5309",
    "ip": "1.1.1.1",
}

response = redact.redact_structured(data=data, redact_format="json")