Skip to content

Latest commit

 

History

History

cloud-client

Google Cloud Data Catalog Python Samples

https://gstatic.com/cloudssh/images/open-btn.png

This directory contains samples for Google Cloud Data Catalog. Google Cloud Data Catalog is a fully managed and scalable metadata management service that empowers organizations to quickly discover, manage, and understand all their data in Google Cloud.

Setup

Authentication

This sample requires you to have authentication setup. Refer to the Authentication Getting Started Guide for instructions on setting up credentials for applications.

Install Dependencies

  1. Clone python-docs-samples and change directory to the sample directory you want to use.

    $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
  2. Install pip and virtualenv if you do not already have them. You may want to refer to the Python Development Environment Setup Guide for Google Cloud Platform for instructions.

  3. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

    $ virtualenv env
    $ source env/bin/activate
  4. Install the dependencies needed to run the samples.

    $ pip install -r requirements.txt

Samples

Lookup entry

https://gstatic.com/cloudssh/images/open-btn.png

To run this sample:

$ python lookup_entry.py

usage: lookup_entry.py [-h]
                       project_id
                       {bigquery-dataset,bigquery-table,pubsub-topic} ...

This application demonstrates how to perform basic operations on entries
with the Cloud Data Catalog API.

For more information, see the README.md under /datacatalog and the
documentation at https://cloud.google.com/data-catalog/docs.

positional arguments:
  project_id            Your Google Cloud project ID
  {bigquery-dataset,bigquery-table,pubsub-topic}
    bigquery-dataset    Retrieves Data Catalog entry for the given BigQuery
                        Dataset.
    bigquery-table      Retrieves Data Catalog entry for the given BigQuery
                        Table.
    pubsub-topic        Retrieves Data Catalog entry for the given Pub/Sub
                        Topic.

optional arguments:
  -h, --help            show this help message and exit

The client library

This sample uses the Google Cloud Client Library for Python. You can read the documentation for more details on API usage and use GitHub to browse the source and report issues.