Skip to main content

datacatalog-tag-manager

A Python package to manage Google Cloud Data Catalog tags, loading metadata from external sources.

CircleCI

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. Create a folder

This is recommended so all related stuff will reside at same place, making it easier to follow below instructions.

mkdir ./datacatalog-tag-manager
cd ./datacatalog-tag-manager

All paths starting with ./ in the next steps are relative to the datacatalog-tag-manager 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 datacatalog-tag-manager

1.2. Docker

Docker may be used as an alternative to run the script. In this case, please disregard the Virtualenv setup instructions.

1.2.1. Get the source code

git clone https://github.com/ricardolsmendes/datacatalog-tag-manager
cd ./datacatalog-tag-manager

1.3. Auth credentials

1.3.1. Create a service account and grant it below roles

  • BigQuery Metadata Viewer
  • Data Catalog TagTemplate User
  • A custom role with bigquery.datasets.updateTag and bigquery.tables.updateTag permissions

1.3.2. Download a JSON key and save it as

  • ./credentials/datacatalog-tag-manager.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-manager.json

2. Load Tags from CSV file

2.1. Create a CSV file representing the Tags to be created

Tags are composed of as many lines as required to represent all of their fields. The columns are described as follows:

Column Description Mandatory
linked_resource Full name of the asset the Entry refers to. Y
template_name Resource name of the Tag Template for the Tag. Y
column Attach Tags to a column belonging to the Entry schema. N
field_id Id of the Tag field. Y
field_value Value of the Tag field. Y

TIPS

2.2. Run the datacatalog-tag-manager script

  • Python + virtualenv
datacatalog-tag-manager create-tags --csv-file CSV_FILE_PATH
  • Docker
docker build --rm --tag datacatalog-tag-manager .
docker run --rm --tty \
  --volume CREDENTIALS_FILE_FOLDER:/credentials --volume CSV_FILE_FOLDER:/data \
  datacatalog-tag-manager create-tags --csv-file /data/CSV_FILE_NAME

Metadata

Release files for datacatalog-tag-manager 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datacatalog-tag-manager 0.1.4
File Size Uploaded Provenance Actions
datacatalog-tag-manager-0.1.4.tar.gz 6.7 kB Without provenance Details for datacatalog-tag-manager-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datacatalog-tag-manager 0.1.4
File Interpreter ABI Platform Actions
datacatalog_tag_manager-0.1.4-py2.py3-none-any.whl Python 3, Python 2 none any Details for datacatalog_tag_manager-0.1.4-py2.py3-none-any.whl

Total release size: 15.9 kB

Release files / datacatalog-tag-manager-0.1.4.tar.gz

Download URL datacatalog-tag-manager-0.1.4.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e6615512607301886e5f73b7801afb50f4921dd3bf862f9b012e9324cb2b0939
BLAKE2b-256 checksum
How to use checksums
a61d0f0fae852567e6fefd33646aad590e2cf12bf21f3e1300653ed5e4c0e30e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

Release files / datacatalog_tag_manager-0.1.4-py2.py3-none-any.whl

Download URL datacatalog_tag_manager-0.1.4-py2.py3-none-any.whl
Size 9.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4e6ac7323823b5c6f5d3b647dce20e6930afea55b7eb29a132b9319fef71a8d5
BLAKE2b-256 checksum
How to use checksums
81051c60bee1baad952e8f1b463faa05146c8dda643d83ed3cd1be8688a51211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

Security for datacatalog-tag-manager 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page