Google Cloud BigLake Client Library for Python

0.3.0 · active · verified Fri Apr 17

The `google-cloud-biglake` library provides a Python client for interacting with the Google Cloud BigLake API. BigLake allows you to unify data lakes and warehouses, enabling a consistent management plane and access control for data stored in various formats across Google Cloud (e.g., Cloud Storage) and other clouds. It is currently in a 0.x.x version, indicating early access or preview, and is part of the larger `googleapis/google-cloud-python` monorepo, receiving updates as the underlying API evolves.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the BigLakeServiceClient and list existing BigLake catalogs within a specified Google Cloud project and location. It assumes you have Application Default Credentials (ADC) configured or `GOOGLE_APPLICATION_CREDENTIALS` environment variable set.

import os
from google.cloud.biglake_v1 import BigLakeServiceClient

# Set your Google Cloud Project ID and Location
# You can also set GOOGLE_CLOUD_PROJECT environment variable
project_id = os.environ.get('GCP_PROJECT_ID', 'your-project-id')
location = os.environ.get('GCP_LOCATION', 'us-central1') # e.g., 'us-central1', 'europe-west1'

if project_id == 'your-project-id' or location == 'us-central1':
    print("Please set GCP_PROJECT_ID and GCP_LOCATION environment variables or replace placeholders.")
    exit()

client = BigLakeServiceClient()

# Construct the parent path for listing catalogs
# The parent must be in the format: projects/{project}/locations/{location}
parent_path = f"projects/{project_id}/locations/{location}"

try:
    # List BigLake catalogs within the specified project and location
    print(f"Listing BigLake catalogs in {parent_path}:")
    for catalog in client.list_catalogs(parent=parent_path):
        print(f"  Catalog: {catalog.name}")
except Exception as e:
    print(f"An error occurred: {e}")
    print("Ensure BigLake API is enabled and your service account has 'biglake.catalogs.list' permission.")

view raw JSON →