In this recipe, we take an input data.csv which has some sensitive data. A Python program parses the file and generates a request JSON file for the API. The second part of the same Python program validates the response and gives a custom output to the user:
- Navigate to the Chapter19/using_dlp_api folder.
- The Python program check-with-dlp.py reads the data from the data.csv file and generates a request. The request is sent to the DLP API and the response is parsed to find if there is sensitive information in the data sent. The first part of the code is the initial setup for the program:
# -*- coding: utf-8 -*-"""@author: Legorie# The code identifies sensitive information and logs it on the console"""import jsonimport requests ...