Skip to content

Files

This branch is 32154 commits behind googleapis/google-cloud-python:main.

dlp

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 28, 2018
Nov 30, 2018
Nov 28, 2018
Nov 29, 2018
Nov 28, 2018
Oct 18, 2018
Jul 24, 2018
Jul 24, 2018
Oct 17, 2018
Dec 1, 2018
Feb 14, 2018
Dec 3, 2018
Nov 19, 2018
Nov 29, 2018

Python Client for Cloud Data Loss Prevention (DLP) API

alpha pypi versions

Cloud Data Loss Prevention (DLP) API: Provides methods for detection, risk analysis, and de-identification of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Cloud Data Loss Prevention (DLP) API.
  4. Setup Authentication.

Installation

Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.

With virtualenv, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

Mac/Linux

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-dlp

Windows

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-dlp

Preview

DlpServiceClient

from google.cloud import dlp_v2

client = dlp_v2.DlpServiceClient()

name = 'EMAIL_ADDRESS'
info_types_element = {'name': name}
info_types = [info_types_element]
inspect_config = {'info_types': info_types}
type_ = 'text/plain'
value = 'My email is [email protected].'
items_element = {'type': type_, 'value': value}
items = [items_element]

response = client.inspect_content(inspect_config, items)

Next Steps