Google Cloud Python Client Libraries

repository·main·Indexed 26 days ago

https://github.com/googleapis/google-cloud-python

A collection of Python client libraries for Google Cloud services, including BigQuery DataFrames, Cloud Data Fusion, and Cloud Spanner integration for Django. It includes the google-api-core library, the gapic-generator for API client descriptions, and specialized libraries such as google-ads-admanager and google-ads-datamanager.

Tokens
101.6K
Snippets
292
Records
605
Agent score
80%

What's inside google-cloud-python

  1. Install the GDC Hardware Management client library

    main

    Install the google-cloud-gdchardwaremanagement library within a virtual environment to avoid dependency conflicts.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Python <= 3.9 is unsupported.
    ### Mac/Linux
    ```bash
    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-gdchardwaremanagement

    Windows

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-cloud-gdchardwaremanagement
  2. Install the Google Cloud Compute v1beta library

    main

    Install the library within a virtual environment to isolate dependencies.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Python <= 3.9 is unsupported.

    Mac/Linux Installation:

    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-compute-v1beta

    Windows Installation:

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-cloud-compute-v1beta
    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-compute-v1beta
  3. Install the google-cloud-beyondcorp-appgateways library

    main

    Install the library within a virtual environment to avoid dependency conflicts. The library supports Python >= 3.10 (including 3.14). Python versions <= 3.9 are not supported.

    Mac/Linux

    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-beyondcorp-appgateways

    Windows

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-cloud-beyondcorp-appgateways
    pip install google-cloud-beyondcorp-appgateways
  4. Install the google-cloud-backupdr library

    main

    Install the Backup and DR Service client library using pip within a virtual environment.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Python <= 3.9 is unsupported.

    Prerequisites:

    1. Select or create a Cloud Platform project.
    2. Enable billing for your project.
    3. Enable the Backup and DR Service.
    4. Set up Authentication.
    # Mac/Linux
    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-backupdr
    
    # Windows
    py -m venv <your-env>
    .<your-env>\Scripts\activate
    pip install google-cloud-backupdr
  5. Install the Distributed Cloud Edge Container client library

    main

    Install the google-cloud-edgecontainer library within a virtual environment to avoid dependency conflicts.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Python <= 3.9 is unsupported.

    Prerequisites:

    1. Select or create a Cloud Platform project.
    2. Enable billing for your project.
    3. Enable the Distributed Cloud Edge Container API.
    4. Set up Authentication.
    ### Mac/Linux
    
    ```bash
    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-edgecontainer

    Windows

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-cloud-edgecontainer
  6. Install google-ai-generativelanguage

    main

    Install the library within a virtual environment (venv) to isolate dependencies.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Unsupported: Python <= 3.9

    Mac/Linux Installation:

    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-ai-generativelanguage

    Windows Installation:

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-ai-generativelanguage
    pip install google-ai-generativelanguage
  7. Install the Certificate Manager Python client

    main

    Install the google-cloud-certificate-manager library within a virtual environment to avoid dependency conflicts.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Python <= 3.9 is unsupported.
    ### Mac/Linux
    ```bash
    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-certificate-manager

    Windows

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-cloud-certificate-manager
  8. Install the Google Compute Engine Python client

    main

    Install the google-cloud-compute-v1beta library within a virtual environment to avoid dependency conflicts.

    Supported Python Versions:

    • Python >= 3.10 (including 3.14)
    • Unsupported: Python <= 3.9

    Prerequisites:

    1. Select or create a Cloud Platform project.
    2. Enable billing for your project.
    3. Enable the Google Compute Engine API.
    4. Set up Authentication.
    ### Mac/Linux
    ```bash
    python3 -m venv <your-env>
    source <your-env>/bin/activate
    pip install google-cloud-compute-v1beta

    Windows

    py -m venv <your-env>
    .\<your-env>\Scripts\activate
    pip install google-cloud-compute-v1beta
  9. Configure logging for the Lakehouse library

    main

    The library uses standard Python logging to log RPC events. By default, logging events are not handled and must be explicitly configured.

    Simple Environment-Based Configuration

    Set the GOOGLE_SDK_PYTHON_LOGGING_SCOPE environment variable to a valid Google logging scope (a period-separated namespace starting with google) to enable default handling at logging.DEBUG or higher.

    • All Google loggers: export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google
    • Specific module: export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1

    Advanced Code-Based Configuration

    Use Python's logging module to configure handlers manually.

    Note: By default, logging events from the google logger do not propagate to the root logger. To enable propagation, set logging.getLogger("google").propagate = True.

    ### Enabling the default handler for all Google-based loggers (Environment)
    ```bash
    export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google

    Configuring a handler for all Google-based loggers (Code)

    import logging
    from google.cloud import library_v1
    
    base_logger = logging.getLogger("google")
    base_logger.addHandler(logging.StreamHandler())
    base_logger.setLevel(logging.DEBUG)