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, strict JSON-compatible input and output schemas, one execution adapter, permission metadata, safety level, and bounded timeout.

Arguments are validated before execution and adapter results are validated before they cross a tool boundary. MCP input schemas, output schemas, safety annotations, CLI discovery, capability references, and compatibility snapshots are generated from the same registry.

from GoogleCloudPlatformAPI.ai_native import (
    capability_reference_markdown,
    capability_registry,
    compatibility_snapshot,
    readiness_score,
)

print(capability_registry.schema())
print(compatibility_snapshot(capability_registry))
print(capability_reference_markdown(capability_registry))
print(readiness_score(capability_registry))

Inspect the same machine-readable registry from the command line:

gcp-api-agent --list-capabilities

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, docs/capabilities.md, and llms.txt for the repository copies of these contracts and generated references.

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)

Metadata

Release files for GoogleCloudPlatformAPI 2.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GoogleCloudPlatformAPI 2.8.1
File Size Uploaded
googlecloudplatformapi-2.8.1.tar.gz 94.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GoogleCloudPlatformAPI 2.8.1
File Interpreter ABI Platform
googlecloudplatformapi-2.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 171.4 kB

Release files / googlecloudplatformapi-2.8.1.tar.gz

Download URL googlecloudplatformapi-2.8.1.tar.gz
Size 94.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0ab41a8da429482b7e7e1d742c228ca33a9f6045ce6231ab0c718fda0d4855b3
BLAKE2b-256 checksum
How to use checksums
f82c2be9b206d0d20218984e4f6f09cafcccd6375589ccdfae6107a44e21af7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / googlecloudplatformapi-2.8.1-py3-none-any.whl

Download URL googlecloudplatformapi-2.8.1-py3-none-any.whl
Size 77.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
131d0e3a697c34c7c39651d1ee2045daa577b054e6e18b300eacdd869e7d432d
BLAKE2b-256 checksum
How to use checksums
1126a3351943ba18550b9bb9224f6d9d552694af950ef85778683c248be8577a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.8.1 This release

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.3.6

2 release files

2.3.5

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

1.12

2 release files

1.11

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page