Registry / gcp / google-cloud-parametermanager

google-cloud-parametermanager

JSON →
library0.4.0pypypi✓ verified 82d ago

google-cloud-parametermanager is the Python client library for the Google Cloud Parametermanager API. This service, an extension to Secret Manager, provides a centralized and secure store for application configuration parameters such as environment variables, feature flags, and API keys. It offers features like data encryption, versioning, support for structured formats (YAML, JSON), and fine-grained Identity and Access Management (IAM) controls. The current version is 0.4.0, and as part of the `google-cloud-python` monorepo, its sub-libraries receive frequent updates.

pip install google-cloud-parametermanager
INSTALL
IMPORT
SIG · GOOGLE-CLOUD-PARAM
G
google-cloud-parametermanager
gcppythonv0.4.0
Install
5.3s avg
Import
Disk
67MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 68.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.3s · import 0.000s · 66MB
67MB installed
● package 67MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ParameterManagerServiceClient
from google.cloud import parametermanager_v1
from google.cloud.parametermanager_v1 import ParameterManagerServiceClient

This quickstart initializes the Parameter Manager client and lists all parameters configured within a specified Google Cloud project and the 'global' location. It demonstrates basic client instantiation and interaction, highlighting the importance of setting the project ID and having appropriate IAM permissions. Ensure Application Default Credentials (ADC) are configured for authentication.

import os from google.cloud.parametermanager_v1 import ParameterManagerServiceClient def quickstart_parametermanager(project_id: str): """ Initializes the Parameter Manager client and lists parameters in a project. Requires GOOGLE_APPLICATION_CREDENTIALS to be set or ADC to be configured. """ if not project_id or project_id == "your-gcp-project-id": print("Please provide a valid Google Cloud Project ID.") print("Set the GOOGLE_CLOUD_PROJECT environment variable or update the project_id variable.") return client = ParameterManagerServiceClient() # The parent format is projects/{project_id}/locations/{location} # 'global' is a common location for many Parameter Manager operations. parent = f"projects/{project_id}/locations/global" try: print(f"Listing parameters in project {project_id} (location: global)...") # List all parameters in the specified project and location for parameter in client.list_parameters(parent=parent): print(f" Parameter Name: {parameter.name}") print(f" Format: {parameter.format.name}") print(f" Create Time: {parameter.create_time}") if parameter.labels: print(f" Labels: {parameter.labels}") print("---") except Exception as e: print(f"An error occurred: {e}") print("Ensure the Parameter Manager API is enabled for your project and your credentials have 'roles/parametermanager.viewer' or similar permissions.") if __name__ == "__main__": # Replace 'your-gcp-project-id' with your actual Google Cloud Project ID. # For local development, ensure Application Default Credentials are set up: # 1. `gcloud auth application-default login` # 2. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your service account key file path. project_id = os.environ.get("GOOGLE_CLOUD_PROJECT", "your-gcp-project-id") quickstart_parametermanager(project_id)
Debug
Known issues
breakingThe `google-cloud-parametermanager` library is currently in 'Public Preview' status. This means it is under active development, and any release is subject to backwards-incompatible changes at any time. Features, API surfaces, and behavior may change without extensive deprecation periods.
fix
Always pin the exact version (`pip install google-cloud-parametermanager==X.Y.Z`) in production. Regularly review release notes and test against new versions before deploying.
affects: 0.x.x (all preview versions)
gotchaImproper IAM permissions for the service account or user account used to access the Parameter Manager API will result in `PermissionDenied` errors.
fix
Ensure the principal has the necessary roles (e.g., `roles/parametermanager.viewer` for reading, `roles/parametermanager.editor` for creating/updating, `roles/parametermanager.admin` for full control) on the project or specific parameter resources. For referencing Secret Manager secrets, the Parameter Manager service identity must also have `Secret Manager Secret Accessor` permission on the referenced secrets.
affects: All versions
gotchaAuthentication to Google Cloud APIs, including Parameter Manager, relies on Application Default Credentials (ADC). Misconfiguration of ADC often leads to authentication errors or unexpected behavior.
fix
For local development, use `gcloud auth application-default login` or set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of a service account key file. For deployed applications, leverage managed identities like service accounts on Compute Engine, Cloud Run, GKE, etc., with appropriate IAM roles.
affects: All versions
Upgrade
Version history
0.4.0latest on PyPI · released Mar 26, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
Agent activity
33 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
google-cloud-parametermanager — pip install google-cloud-parametermanager · libregistry