In the Developer Edition, a user uploads a file using the sample application, which is processed by the Data Discovery container. The containers detect sensitive data. A Python module then redacts or masks the data. The sanitized file is saved to a configured location. For more information about the sample application, refer to Sample application.
Use the steps provided here to run the application end-to-end. If required, run the APIs and functions provided for performing specific tasks. For more information about the identification APIs, refer to Data Discovery API.
Running the sample application
The sample application is configured out-of-the-box to identify and redact data from the sample file.
Open a command prompt.
Navigate to the directory where Developer Edition is cloned.
Run the sample application using the following command.
python samples/sample-app-find-and-redact.pyView the output of the files processed on the screen. The output displays a list of sensitive items in the source file. It also displays the location and name of the output file with the redacted output.

- View the processed output file in the output directory.
Integrating the Python module in an application
Alternatively, to integrate and use the Protegrity Python module in a Python application, customize and use the sample code provided here.
Open a command prompt.
Create a Python file.
Import the installed Python module.
import protegrity_developer_pythonSpecify the configuration. For more information about the settings, refer to the Python module configuration.
protegrity_developer_python.configure( endpoint_url="http://localhost:8580/pty/data-discovery/v1.0/classify", named_entity_map={"PERSON": "NAME", "SOCIAL_SECURITY_NUMBER": "SSN"}, masking_char="#", classification_score_threshold=0.6, method="redact", enable_logging=True, log_level="info" )Specify the input text.
input_text = "John Doe's SSN is 123-45-6789."Call the module to process the data.
output_text = protegrity_developer_python.find_and_redact(input_text)View the redacted output.
print(output_text)Save, close, and run the file.