A package to manage Google Cloud Data Catalog Tag Template scripts.
Disclaimer: This is not an officially supported Google product.
# 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 conventions
export GOOGLE_APPLICATION_CREDENTIALS=~/datacatalog-tag-template-processor-sa.json
# Install datacatalog-tag-template-processor
pip3 install datacatalog-tag-template-processor --user
# Add to your PATH
export PATH=~/.local/bin:$PATH
# Look for available commands
datacatalog-tag-template-processor --help
Using virtualenv is optional, but strongly recommended unless you use Docker.
git clone https://github.com/mesmacosta/datacatalog-tag-template-processor
cd ./datacatalog-tag-template-processor
All paths starting with ./
in the next steps are relative to the datacatalog-tag-template-processor
folder.
pip install --upgrade virtualenv
python3 -m virtualenv --python python3 env
source ./env/bin/activate
pip install --upgrade .
Docker may be used as an alternative to run the script. In this case, please disregard the Virtualenv setup instructions.
- Data Catalog Admin
This name is just a suggestion, feel free to name it following your naming conventions
./credentials/datacatalog-tag-template-processor-sa.json
This step may be skipped if you're using Docker.
export GOOGLE_APPLICATION_CREDENTIALS=~/credentials/datacatalog-tag-template-processor-sa.json
Templates are composed of as many lines as required to represent all of their fields. The columns are described as follows:
Column | Description | Mandatory |
---|---|---|
template_name | Resource name of the Tag Template for the Tag. | Y |
display_name | Resource name of the Tag Template for the Tag. | Y |
field_id | Id of the Tag Template field. | Y |
field_display_name | Display name of the Tag Template field. | Y |
field_type | Type of the Tag Template field. | Y |
enum_values | Values for the Enum field. | N |
- Python + virtualenv
datacatalog-tag-template-processor tag-templates create --csv-file CSV_FILE_PATH
- Python + virtualenv
datacatalog-tag-template-processor tag-templates delete --csv-file CSV_FILE_PATH
TIPS
- sample-input/create-tag-templates for reference;