Package: datacatalog-tag-template-processor
Datacatalog Tag Template ProcessorA package to manage Google Cloud Data Catalog Tag Template scripts.Disclaimer: This is not an officially supported Google product.Table of ContentsExecuting in Cloud Shell1. Environment setup1.1. Python + virtualenv1.1.1. Install Python 3.6+1.1.2. Get the source code1.1.3. Create and activate an isolated Python environment1.1.4. Install the package1.2. Docker1.3. Auth credentials1.3.1. Create a service account and grant it below roles1.3.2. Download a JSON key and save it as1.3.3. Set the environment variables2. Load Templates from CSV file2.1. Create a CSV file representing the Templates to be created2.2. Run the ddatacatalog-tag-template-processor script - Create the Tag Templates2.3. Run the datacatalog-tag-template-processor script - Delete the Tag TemplatesExecuting in Cloud 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-processor-sa.json# Install datacatalog-tag-template-processorpip3installdatacatalog-tag-template-processor--user# Add to your PATHexportPATH=~/.local/bin:$PATH# Look for available commandsdatacatalog-tag-template-processor--help1. Environment setup1.1. Python + virtualenvUsingvirtualenvis optional, but strongly recommended unless you useDocker.1.1.1. Install Python 3.6+1.1.2. Get the source codegitclonehttps://github.com/mesmacosta/datacatalog-tag-template-processorcd./datacatalog-tag-template-processorAll paths starting with./in the next steps are relative to thedatacatalog-tag-template-processorfolder.1.1.3. Create and activate an isolated Python environmentpipinstall--upgradevirtualenv
python3-mvirtualenv--pythonpython3envsource./env/bin/activate1.1.4. Install the packagepipinstall--upgrade.1.2. DockerDocker may be used as an alternative to run the script. In this case, please disregard theVirtualenvsetup instructions.1.3. Auth credentials1.3.1. Create a service account and grant it below rolesData Catalog Admin1.3.2. Download a JSON key and save it asThis name is just a suggestion, feel free to name it following your naming conventions./credentials/datacatalog-tag-template-processor-sa.json1.3.3. Set the environment variablesThis step may be skipped if you're usingDocker.exportGOOGLE_APPLICATION_CREDENTIALS=~/credentials/datacatalog-tag-template-processor-sa.json2. Load Templates from CSV file2.1. Create a CSV file representing the Templates to be createdTemplates are composed of as many lines as required to represent all of their fields. The columns are
described as follows:ColumnDescriptionMandatorytemplate_nameResource name of the Tag Template for the Tag.Ydisplay_nameResource name of the Tag Template for the Tag.Yfield_idId of the Tag Template field.Yfield_display_nameDisplay name of the Tag Template field.Yfield_typeType of the Tag Template field.Yenum_valuesValues for the Enum field.N2.2. Run the ddatacatalog-tag-template-processor script - Create the Tag TemplatesPython + virtualenvdatacatalog-tag-template-processortag-templatescreate--csv-fileCSV_FILE_PATH2.3. Run the datacatalog-tag-template-processor script - Delete the Tag TemplatesPython + virtualenvdatacatalog-tag-template-processortag-templatesdelete--csv-fileCSV_FILE_PATHTIPSsample-input/create-tag-templatesfor reference;History0.1.0 (2020-04-14)First release on PyPI.