管理Google云数据目录文件集导出脚本的包
datacatalog-fileset-exporter的Python项目详细描述
Datacatalog文件集导出器
管理Google云数据目录文件集导出脚本的Python包。在
免责声明:这不是官方支持的谷歌产品。
目录
- Executing in Cloud Shell
- 1. Environment setup 在
- 2. Export Filesets 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-fileset-exporter-sa.json # Install datacatalog-fileset-exporter pip3 install datacatalog-fileset-exporter --user # Add to your PATHexportPATH=~/.local/bin:$PATH# Look for available commands datacatalog-fileset-exporter --help
1。环境设置
1.1条。Python+virtualenv
使用virtualenv是可选的,但强烈建议您除非使用Docker。在
1.1.1。安装Python 3.6+
1.1.2。获取源代码
^{pr2}$下一步中以./
开头的所有路径都是相对于datacatalog-fileset-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。创建服务帐户并授予其以下角色
- 数据目录管理员
此名称只是一个建议,请按照您的命名约定随意命名
./credentials/datacatalog-fileset-exporter-sa.json
1.3.3。设置环境变量
如果使用Docker,则可以跳过此步骤。
exportGOOGLE_APPLICATION_CREDENTIALS=~/credentials/datacatalog-fileset-exporter-sa.json
2。将文件集导出到CSV文件
2.1条。将创建一个代表文件集的CSV文件
文件集由表示其所有字段所需的任意多行组成。列是 描述如下:
Column | Description | Mandatory |
---|---|---|
entry_group_name | Entry Group Name. | Y |
entry_group_display_name | Entry Group Display Name. | Y |
entry_group_description | Entry Group Description. | Y |
entry_id | Entry ID. | Y |
entry_display_name | Entry Display Name. | Y |
entry_description | Entry Description. | Y |
entry_file_patterns | Entry File Patterns. | Y |
schema_column_name | Schema column name. | N |
schema_column_type | Schema column type. | N |
schema_column_description | Schema column description. | N |
schema_column_mode | Schema column mode. | N |
2.2条。运行datacatalog fileset exporter脚本
- Python+virtualenv
datacatalog-fileset-exporter filesets export --project-ids my-project --file-path CSV_FILE_PATH
历史
0.1.0(2020年4月28日)
- PyPI的第一个版本。在
0.2.0(2020-05-08)
- 添加使用文件集创建日期的选项。在
- 项目
标签: