{"id":5945,"library":"google-cloud-common","title":"Google Cloud Common API client library","description":"google-cloud-common is a foundational Python library that provides generated Python types and common helpers for other Google Cloud client libraries. It is not typically used as a standalone application client but serves as an internal dependency for service-specific client libraries within the `google-cloud-python` ecosystem. The current version is 1.9.0. It is actively maintained as part of the broader Google Cloud Python client libraries, which have a frequent release cadence.","status":"active","version":"1.9.0","language":"en","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-common","tags":["google-cloud","utility","client-library","protobuf","types","foundational"],"install":[{"cmd":"pip install google-cloud-common","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides core functionality for Google API clients, including retry mechanisms and pagination.","package":"google-api-core"},{"reason":"Facilitates Pythonic representation of Protocol Buffer messages.","package":"proto-plus"},{"reason":"Core library for Google's Protocol Buffers, used for data serialization.","package":"protobuf"}],"imports":[{"note":"google-cloud-common provides generated types and helpers. It is not designed for direct interaction by end-users to perform service operations. Instead, it underpins other service-specific client libraries.","symbol":"google.cloud.common","correct":"This library is primarily an internal dependency; direct end-user imports for functional use are rare. Its components are typically consumed by other `google-cloud-*` client libraries."}],"quickstart":{"code":"import os\nfrom google.cloud import storage\n\n# This example uses google-cloud-storage, which relies on common infrastructure\n# like that provided by google-cloud-common for its base functionality and types.\n# Ensure GOOGLE_APPLICATION_CREDENTIALS environment variable is set\n# or running in a Google Cloud environment with default credentials.\n# For local development, set GOOGLE_APPLICATION_CREDENTIALS to the path of your service account key file.\n# os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '/path/to/your/key.json'\n\ntry:\n    # Initialize a client for Google Cloud Storage\n    # This implicitly uses authentication mechanisms supported by google-cloud-common's underlying components.\n    client = storage.Client()\n    \n    # Attempt to list buckets to verify authentication and client setup\n    buckets = list(client.list_buckets())\n    print(f\"Successfully listed {len(buckets)} buckets.\")\n    if buckets:\n        print(f\"First bucket: {buckets[0].name}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure your Google Cloud environment is set up and authenticated.\")\n    print(\"  - Set GOOGLE_APPLICATION_CREDENTIALS to your service account key file path, or\")\n    print(\"  - Run in a Google Cloud environment (e.g., Cloud Shell, GCE, Cloud Run).\")\n","lang":"python","description":"Since `google-cloud-common` primarily provides foundational types and helpers, it does not have a typical 'hello world' for direct use. This quickstart demonstrates how to set up and use a common Google Cloud client library (Google Cloud Storage) which relies on the common infrastructure provided by `google-cloud-common` for authentication and core functionality. This ensures your environment is correctly configured to use Google Cloud Python client libraries."},"warnings":[{"fix":"For interacting with a specific Google Cloud service, install and use the client library for that service (e.g., `pip install google-cloud-storage` and `from google.cloud import storage`).","message":"google-cloud-common is an internal dependency and provides generated Python types and common helpers. It is not intended for direct use by end-users for performing Google Cloud service operations. Instead, it is a building block for other service-specific client libraries (e.g., `google-cloud-storage`, `google-cloud-pubsub`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the `Requires-Python` metadata on PyPI for the specific version of `google-cloud-common` you intend to use. Google Cloud recommends keeping your Python environment updated to actively supported versions (currently Python 3.9+ for `google-cloud-common`, but trending towards 3.10+ for the ecosystem) to ensure continued compatibility and receive critical updates.","message":"While `google-cloud-common==1.9.0` currently supports Python >=3.9, the broader Google Cloud Python client library ecosystem is actively dropping support for older Python versions. For example, `pandas-gbq` recently dropped Python 3.9 support in `v0.35.0` (released 2026-04-09), requiring Python 3.10+.","severity":"breaking","affected_versions":"Future minor/major versions of `google-cloud-common` are highly likely to drop support for Python 3.9 and potentially 3.10 as they reach end-of-life."},{"fix":"Take care to restrict access to logs if they are saved. To enable default logging without code changes, set the `GOOGLE_SDK_PYTHON_LOGGING_SCOPE` environment variable. To propagate logs to the root logger for custom handling, explicitly set `logging.getLogger('google').propagate = True` in your application code.","message":"The library utilizes standard Python logging functionality. Logs may contain sensitive information. By default, logging events from `google-cloud-common` (and other `google` namespace loggers) are not propagated up to the root logger.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}