A package to manage Google Cloud Data Catalog Tag Template scripts
Project description
Datacatalog Tag Template Processor
A package to manage Google Cloud Data Catalog Tag Template scripts.
Disclaimer: This is not an officially supported Google product.
Table of Contents
- Executing in Cloud Shell
- 1. Environment setup
- 2. Load Templates from CSV file
Executing 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 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
1. Environment setup
1.1. Python + virtualenv
Using virtualenv is optional, but strongly recommended unless you use Docker.
1.1.1. Install Python 3.6+
1.1.2. Get the source code
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.
1.1.3. Create and activate an isolated Python environment
pip install --upgrade virtualenv
python3 -m virtualenv --python python3 env
source ./env/bin/activate
1.1.4. Install the package
pip install --upgrade .
1.2. Docker
Docker may be used as an alternative to run the script. In this case, please disregard the Virtualenv setup instructions.
1.3. Auth credentials
1.3.1. Create a service account and grant it below roles
- Data Catalog Admin
1.3.2. Download a JSON key and save it as
This name is just a suggestion, feel free to name it following your naming conventions
./credentials/datacatalog-tag-template-processor-sa.json
1.3.3. Set the environment variables
This step may be skipped if you're using Docker.
export GOOGLE_APPLICATION_CREDENTIALS=~/credentials/datacatalog-tag-template-processor-sa.json
2. Load Templates from CSV file
2.1. Create a CSV file representing the Templates to be created
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 |
2.2. Run the ddatacatalog-tag-template-processor script - Create the Tag Templates
- Python + virtualenv
datacatalog-tag-template-processor tag-templates create --csv-file CSV_FILE_PATH
2.3. Run the datacatalog-tag-template-processor script - Delete the Tag Templates
- Python + virtualenv
datacatalog-tag-template-processor tag-templates delete --csv-file CSV_FILE_PATH
TIPS
- sample-input/create-tag-templates for reference;
History
0.1.0 (2020-04-14)
- First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file datacatalog-tag-template-processor-0.2.0.tar.gz
.
File metadata
- Download URL: datacatalog-tag-template-processor-0.2.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebc0f4802fe8495a7abf5009fdfd35d6e8df99056018967b3693ff7a82059af5 |
|
MD5 | 0fddca8b0502d63e95e6f89c6f135c83 |
|
BLAKE2b-256 | 1a6816dee0e04b7d5716fe29972cbf1d1ef171f37c936772c382ff8c992f6063 |
File details
Details for the file datacatalog_tag_template_processor-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: datacatalog_tag_template_processor-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dbd7940615e80e996d6c10ef7bbbb06b23989d07552b3e5b93a3434201624a5 |
|
MD5 | 262fe66394a5858c19d156321f12de75 |
|
BLAKE2b-256 | 4518a5f56215fe43d000508638cc8654fb2b38dcf213f4ab365a625aa954c096 |