Skip to main content

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_context
  • bigquery_list_datasets
  • bigquery_list_tables
  • bigquery_table_schema
  • bigquery_query
  • gcs_list_objects
  • gcs_object_metadata
  • gcs_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

googlecloudplatformapi-2.7.0.tar.gz (62.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

googlecloudplatformapi-2.7.0-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

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

Hashes for googlecloudplatformapi-2.7.0.tar.gz
Algorithm Hash digest
SHA256 3bcd0acbe592fcef7251f90b1c28becde44e7bdca285e5aa84858f9a0b9c0e95
MD5 328832d84ebebf93fcdf90f23189abdb
BLAKE2b-256 31879f2792b6f92cfc308c57fc3327aa702788f9c0d86604adddca8813388b62

See more details on using hashes here.

File details

Details for the file googlecloudplatformapi-2.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for googlecloudplatformapi-2.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ab007e5dd2fc04d09c1f0b12dbb610debc452706072ad0f8d789b68d6f4e58a
MD5 d3f37984e2f3600dd1805c9f416e7b4f
BLAKE2b-256 d2e44c93a605991b37aa7c9ffe508e8014ba3e4a19a8b996f56af501f51f525b

See more details on using hashes here.

Release history Release notifications | RSS feed

2.8.1

2 files

2.8.0

2 files

This release

2.7.0 This release

2 files

2.3.6

2 files

2.3.5

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.5

2 files

2.2.4

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.6

2 files

2.1.5

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

2.1.0

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

1.12

2 files

1.11

2 files

1.1

2 files

1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page