A package to manage Google Cloud Data Catalog Tag Template export scripts
Project description
Datacatalog Tag Template Exporter
A Python package to manage Google Cloud Data Catalog Tag Template export scripts.
Disclaimer: This is not an officially supported Google product.
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-exporter-sa.json
# Install datacatalog-tag-template-exporter
pip3 install datacatalog-tag-template-exporter --user
# Add to your PATH
export PATH=~/.local/bin:$PATH
# Look for available commands
datacatalog-tag-template-exporter --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-exporter
cd ./datacatalog-tag-template-exporter
All paths starting with ./
in the next steps are relative to the datacatalog-tag-template-exporter
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
- Storage 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-exporter-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-exporter-sa.json
5. Export Templates to CSV file
5.1. A CSV file representing the Templates will 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 |
---|---|
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. |
5.2. Run the datacatalog-tag-template-exporter script
- Python + virtualenv
datacatalog-tag-template-exporter tag-templates export --project-ids my-project --file-path CSV_FILE_PATH
History
0.1.0 (2020-04-15)
- First release on PyPI.
Project details
Release history Release notifications | RSS feed
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
Hashes for datacatalog-tag-template-exporter-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69fbce2e6a60206c90e4b224a64fda8dd8ce6ebe16bee81c0d3a4d2b4c0a3fd0 |
|
MD5 | a75ee7fa8dca78a8173e666ae3873640 |
|
BLAKE2b-256 | c97f1d8b15a43fba62db96e83b19e30f81a1a30da7b5eeb03748b0b227106d15 |
Hashes for datacatalog_tag_template_exporter-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a34a8a5d1cc807f353f110b9ce43fdfe04f7f2f13c52b259b3a66a37418408e |
|
MD5 | d59eab7a77d09e10b0e234986249a563 |
|
BLAKE2b-256 | 99b2c0e78f518ed4a6afd3c841ec292e614343436f8b60a876e6b8fc058d724b |