一个管理Google云数据目录标签模板导出脚本的包
datacatalog-tag-template-exporter的Python项目详细描述
Datacatalog标记模板导出器
管理Google云数据目录标记模板导出脚本的Python包。在
免责声明:这不是官方支持的谷歌产品。
目录
- Executing in Cloud Shell
- 1. Environment setup 在
- 2. Export Templates to CSV file 在
在云Shell中执行
# Set your SERVICE ACCOUNT, for instructions go to 1.3. Auth credentials# This name is just a suggestion, feel free to name it following your naming conventionsexportGOOGLE_APPLICATION_CREDENTIALS=~/datacatalog-tag-template-exporter-sa.json # Install datacatalog-tag-template-exporter pip3 install datacatalog-tag-template-exporter --user # Add to your PATHexportPATH=~/.local/bin:$PATH# Look for available commands datacatalog-tag-template-exporter --help
1。环境设置
1.1条。Python+virtualenv
使用virtualenv是可选的,但强烈建议您除非使用Docker。在
1.1.1。安装Python 3.6+
1.1.2。获取源代码
^{pr2}$下一步中以./
开头的所有路径都是相对于datacatalog-tag-template-exporter
文件夹。
1.1.3。创建并激活一个独立的Python环境
pip install --upgrade virtualenv
python3 -m virtualenv --python python3 env
source ./env/bin/activate
1.1.4。安装软件包
pip install --upgrade .
1.2条。Docker
Docker可以作为运行脚本的替代方法。在这种情况下,请忽略 Virtualenv安装说明。在
1.3条。身份验证凭据
1.3.1。创建服务帐户并授予其以下角色
- 数据目录管理员
1.3.2。下载一个JSON密钥并将其另存为
此名称只是一个建议,请按照您的命名约定随意命名
./credentials/datacatalog-tag-template-exporter-sa.json
1.3.3。设置环境变量
如果使用的是Docker,则可以跳过此步骤。
exportGOOGLE_APPLICATION_CREDENTIALS=~/credentials/datacatalog-tag-template-exporter-sa.json
2。将模板导出到CSV文件
2.1条。将创建一个表示模板的CSV文件
模板由表示其所有字段所需的任意多行组成。列是 描述如下:
Column | Description |
---|---|
template_name | Resource name of the Tag Template for the Tag. |
display_name | Resource name of the Tag Template for the Tag. |
field_id | Id of the Tag Template field. |
field_display_name | Display name of the Tag Template field. |
field_type | Type of the Tag Template field. |
enum_values | Values for the Enum field. |
2.2条。运行datacatalog标记模板导出器脚本
- Python+virtualenv
datacatalog-tag-template-exporter tag-templates export --project-ids my-project --file-path CSV_FILE_PATH
历史
0.1.0(2020-04-15)
- PyPI的第一个版本。在
- 项目
标签: