GoogleCloudPlatformAPI
Lightweight helpers for common Google Cloud Platform services. The package wraps Google APIs such as BigQuery, Cloud Storage, Analytics, and Ad Manager to reduce boilerplate when building data pipelines or analytics tools.
Installation
pip install GoogleCloudPlatformAPI
Python 3.10 through 3.14 are supported. Runtime dependencies use bounded compatibility ranges, and CI tests both the minimum Python 3.10 dependency set and the newest compatible dependencies.
For development, install the project in editable mode with the tooling extras:
pip install -e '.[dev]'
Run the project checks locally to match CI:
black --check .
pydocstyle GoogleCloudPlatformAPI
pyright GoogleCloudPlatformAPI
pytest -q --cov=GoogleCloudPlatformAPI --cov-report=term-missing --cov-fail-under=90
python -m build
python -m twine check dist/*
Configure authentication with a service account JSON file through
GOOGLE_APPLICATION_CREDENTIALS or supply the path to individual helpers.
Stable public API
Core services and package-defined exceptions are available from the package root:
from GoogleCloudPlatformAPI import (
AuthenticationError,
BigQuery,
CloudStorage,
GoogleCloudPlatformAPIError,
)
Direct module imports remain supported. See docs/public-api.md for naming,
exception, and compatibility rules.
AI-native platform surface
The package uses one canonical capability registry for Python, agent, and MCP/Codex integrations. Each operation has a stable name, semantic version, JSON-compatible input and output schemas, permission metadata, safety level, and bounded timeout.
from GoogleCloudPlatformAPI.ai_native import capability_registry, readiness_score
print(capability_registry.schema())
print(readiness_score(capability_registry))
The wheel includes the machine-readable documentation index, Codex skill, and AI platform documentation:
from GoogleCloudPlatformAPI.assets import read_text_resource
print(read_text_resource("llms.txt"))
print(read_text_resource("codex/SKILL.md"))
See docs/ai-native-platform.md, docs/ai-native-scorecard.md, and llms.txt
for the repository copies of these contracts.
Local Codex plugin surface
The package includes a read-only MCP server for Codex CLI, the Codex desktop app, and compatible local MCP clients. It runs locally over stdio, inherits the current process environment, and never copies or persists Google credentials.
Install the project and verify the entry point:
pip install 'GoogleCloudPlatformAPI[codex]'
gcp-api-mcp
Register the server in your Codex MCP configuration:
[mcp_servers.google_cloud_platform_api]
command = "gcp-api-mcp"
When using a virtual environment, configure the absolute path to its
gcp-api-mcp executable. The server exposes eight read-only tools:
gcp_contextbigquery_list_datasetsbigquery_list_tablesbigquery_table_schemabigquery_querygcs_list_objectsgcs_object_metadatagcs_read_text
The intended workflow is discovery first:
BigQuery: context -> datasets -> tables -> schema -> bounded query
Cloud Storage: context -> objects -> metadata -> bounded text read
BigQuery accepts only statements beginning with SELECT, WITH, or EXPLAIN.
Cloud Storage reads and all result sets are bounded. No upload, delete, table
creation, or other mutation tool is exposed.
Example Codex prompts:
Show my active GCP context, then list available BigQuery datasets.
Inspect project.dataset.table and draft a safe bounded query.
List JSON objects under reports/ and inspect the newest object's metadata.
Read reports/latest.json, limited to 50000 bytes.
The reusable workflow guidance is stored in
.codex/skills/google-cloud-platform-api/SKILL.md and in the installed wheel as
GoogleCloudPlatformAPI/assets/codex/SKILL.md.
Usage
BigQuery
from GoogleCloudPlatformAPI import BigQuery
bq = BigQuery()
df = bq.bigquery_to_dataframe("SELECT CURRENT_DATE() AS today")
print(df)
Cloud Storage
from GoogleCloudPlatformAPI import CloudStorage
storage = CloudStorage()
storage.upload_file_from_filename(
local_file_path="local.txt",
destination_file_path="data/local.txt",
bucket_name="my-bucket",
)
Ad Manager
from GoogleCloudPlatformAPI.AdManager import GamClient
# Assumes GOOGLE_APPLICATION_CREDENTIALS is set
gam_client = GamClient()
network_service = gam_client.get_service(
service_name="NetworkService",
gam_version="v202602",
)
print(network_service.getCurrentNetwork())
Analytics
from GoogleCloudPlatformAPI import Analytics
# Assumes GOOGLE_APPLICATION_CREDENTIALS is set
analytics = Analytics()
profile_id = "12345678"
report = analytics.get_realtime_report(profile_id)
print(report)
OAuth
from GoogleCloudPlatformAPI import ServiceAccount
# Assumes GOOGLE_APPLICATION_CREDENTIALS is set
creds = ServiceAccount.get_service_account_client()
print(creds.project_id)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file googlecloudplatformapi-2.7.0.tar.gz.
File metadata
- Download URL: googlecloudplatformapi-2.7.0.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bcd0acbe592fcef7251f90b1c28becde44e7bdca285e5aa84858f9a0b9c0e95
|
|
| MD5 |
328832d84ebebf93fcdf90f23189abdb
|
|
| BLAKE2b-256 |
31879f2792b6f92cfc308c57fc3327aa702788f9c0d86604adddca8813388b62
|
File details
Details for the file googlecloudplatformapi-2.7.0-py3-none-any.whl.
File metadata
- Download URL: googlecloudplatformapi-2.7.0-py3-none-any.whl
- Upload date:
- Size: 51.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ab007e5dd2fc04d09c1f0b12dbb610debc452706072ad0f8d789b68d6f4e58a
|
|
| MD5 |
d3f37984e2f3600dd1805c9f416e7b4f
|
|
| BLAKE2b-256 |
d2e44c93a605991b37aa7c9ffe508e8014ba3e4a19a8b996f56af501f51f525b
|