A package to manage Google Cloud Data Catalog custom entries
Project description
datacatalog-custom-entries-manager
Python package to manage Google Cloud Data Catalog custom entries, loading metadata from external sources. Currently supports the CSV and JSON file formats.
Table of Contents
- 1. Environment setup
- 2. Manage Custom Entries
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 the same place, making it easier to follow below instructions.
mkdir ./datacatalog-custom-entries-manager
cd ./datacatalog-custom-entries-manager
All paths starting with ./
in the next steps are relative to the
datacatalog-custom-entries-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-custom-entries-manager
1.2. Docker
Docker may be used as an alternative to run datacatalog-custom-entries-manager
. In this case,
please disregard the above virtualenv setup instructions.
1.2.1. Get the source code
git clone https://github.com/ricardolsmendes/datacatalog-custom-entries-manager
cd ./datacatalog-custom-entries-manager
1.3. Auth credentials
1.3.1. Create a service account and grant it below roles
- DataCatalog entryGroup Owner
- DataCatalog entry Owner
- Data Catalog Viewer
1.3.2. Download a JSON key and save it as
./credentials/datacatalog-custom-entries-manager.json
1.3.3. Set the environment variables
This step can be skipped if you're using Docker.
export GOOGLE_APPLICATION_CREDENTIALS=./credentials/datacatalog-custom-entries-manager.json
2. Manage Custom Entries
2.1. Synchronize Data Catalog
2.1.1. To a CSV file
- SAMPLE INPUT
- sample-input/csv for reference;
- Data Catalog Sample Custom Entries (Google Sheets) might help to create/export a CSV file.
- COMMANDS
Python + virtualenv
datacatalog-custom-entries sync \
--csv-file <CSV-FILE-PATH> \
--project-id <YOUR-PROJECT-ID> --location-id <YOUR-LOCATION-ID>
Docker
docker build --rm --tag datacatalog-custom-entries-manager .
docker run --rm --tty \
--volume <CREDENTIALS-FILE-FOLDER>:/credentials --volume <CSV-FILE-FOLDER>:/data \
datacatalog-custom-entries-manager sync \
--csv-file /data/<CSV-FILE-PATH> \
--project-id <YOUR-PROJECT-ID> --location-id <YOUR-LOCATION-ID>
2.1.2. To a JSON file
- SAMPLE INPUT
- sample-input/json for reference;
- COMMANDS
Python + virtualenv
datacatalog-custom-entries sync \
--json-file <JSON-FILE-PATH> \
--project-id <YOUR-PROJECT-ID> --location-id <YOUR-LOCATION-ID>
Docker
docker build --rm --tag datacatalog-custom-entries-manager .
docker run --rm --tty \
--volume <CREDENTIALS-FILE-FOLDER>:/credentials --volume <CSV-FILE-FOLDER>:/data \
datacatalog-custom-entries-manager sync \
--json-file <JSON-FILE-PATH> \
--project-id <YOUR-PROJECT-ID> --location-id <YOUR-LOCATION-ID>
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
Hashes for datacatalog-custom-entries-manager-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 800d14bd5a96c5e951ea4a3291fc7c4485d16fe7919f054cb4472a8a98e851fe |
|
MD5 | d2885a44f286a940496bd64a94a8fe4f |
|
BLAKE2b-256 | 7e322585166952f1d5217301fb190c71f72fa5360874b179c8e90feeff6915ae |
Hashes for datacatalog_custom_entries_manager-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6c407039f709d41d8aa7689c9f8b0b2bfedf48f0c3a7b8c16be036a787ad5a9 |
|
MD5 | 647750c73181fcacae8677ee398d45db |
|
BLAKE2b-256 | f364fc537ff14526b1ea0c5d443e36f0690130cb20a2c546fb3bcb818baeae2b |