云数据丢失预防(DLP)API客户端库
google-cloud-dlp的Python项目详细描述
Cloud Data Loss Prevention (DLP) API:提供检测、风险分析和识别 文本、图像和google云平台中的隐私敏感片段 存储库。
快速启动
要使用此库,首先需要执行以下步骤:
- Select or create a Cloud Platform project.
- Enable billing for your project.
- Enable the Cloud Data Loss Prevention (DLP) API.
- Setup Authentication.
安装
使用pip在virtualenv中安装此库。virtualenv是 创建独立的python环境。它解决的基本问题是 依赖项和版本,以及间接权限。
使用virtualenv,无需系统即可安装此库 安装权限,且不会与已安装的系统发生冲突 依赖关系。
支持的python版本
python=3.5
不推荐的python版本
python==2.7。Python2.7支持将于2020年1月1日取消。
Mac/Linux
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-dlp
窗口
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-dlp
预览
dlpserviceclient
fromgoogle.cloudimportdlp_v2client=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 example@example.com.'items_element={'type':type_,'value':value}items=[items_element]response=client.inspect_content(inspect_config,items)
下一步
- 阅读Client Library Documentation以防止云数据丢失 (dlp)查看客户端上其他可用方法的api。
- 阅读Product documentation到 了解有关产品的更多信息并查看如何指导。