Skip to main content

Utilities and tools for Google Cloud

Project description

pdum_gcp

CI PyPI Python 3.12+ License: MIT Code style: ruff

A GCP admin toolbox

Introduction

pdum_gcp is a toolbox for seasoned administrators who need to nurture Google Cloud estates that sprawl across multiple organizations. Think of the kind of tasks you might script in Terraform, except you want an interactive, incremental workflow that lets one trusted human explore, prototype, and tidy up quickly. This library intentionally does not scale beyond a tiny circle of grizzled operators—ideally a team of one—because it assumes every participating identity has god-like access across those organizations.

The focus here is admin hygiene: inspecting estates, checking IAM, enabling required APIs, and wiring up billing or quota projects. Once the scaffolding exists, you drop back into the regular Google Cloud Python clients to actually use the resources. A core tenet is “bring your own identity”: everything runs under your Application Default Credentials, which belong to you, not the orgs you help. That makes this powerful, but also dangerous—misplaced trust, compromised credentials, or sloppy copy/paste can translate into real financial and operational damage.

Use this library only if you:

  • Operate in small, high-trust environments where rapid create/tear-down cycles matter.
  • Regularly hop between organizations or short-lived projects.
  • Understand that you are working with loaded weapons and accept the risk.

Feature Highlights

  • Pre-flight your environment with doctor() to confirm identity, quota project, and API readiness.
  • Explore estates with list_organizations(), walk_projects(), and container helpers.
  • Resolve quota projects and billing details with quota_project() and billing sentinels.
  • Inspect IAM with get_iam_policy() and list_roles() before making changes.
  • Map friendly API names to service IDs via lookup_api() and the bundled catalog.

🧭 Ready to see it in action? Follow the Interactive Admin Tutorial for a guided, output-rich walkthrough (with sensitive identifiers anonymized).

Development

This project uses UV for dependency management.

Setup

# Install UV if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/habemus-papadum/pdum_gcp.git
cd pdum_gcp

# Provision the entire toolchain (uv sync, pnpm install, widget build, pre-commit hooks)
./scripts/setup.sh

Important for Development:

  • ./scripts/setup.sh is idempotent—rerun it after pulling dependency changes
  • Use uv sync --frozen to ensure the lockfile is respected when installing Python deps

Running Tests

# Run all tests
uv run pytest

# Run a specific test file
uv run pytest tests/test_example.py

# Run a specific test function
uv run pytest tests/test_example.py::test_version

# Run tests with coverage
uv run pytest --cov=src/pdum/gcp --cov-report=xml --cov-report=term

Code Quality

# Check code with ruff
uv run ruff check .

# Format code with ruff
uv run ruff format .

# Fix auto-fixable issues
uv run ruff check --fix .

Building

# Build Python + TypeScript artifacts
./scripts/build.sh

# Or build just the Python distribution artifacts
uv build

Publishing

# Build and publish to PyPI (requires credentials)
./scripts/publish.sh

Automation scripts

  • ./scripts/setup.sh – bootstrap uv, pnpm, widget bundle, and pre-commit hooks
  • ./scripts/build.sh – reproduce the release build locally
  • ./scripts/pre-release.sh – run the full battery of quality checks
  • ./scripts/release.sh – orchestrate the release (creates tags, publishes to PyPI/GitHub)
  • ./scripts/test_notebooks.sh – execute demo notebooks (uses ./scripts/nb.sh under the hood)
  • ./scripts/setup-visual-tests.sh – install Playwright browsers for visual tests

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

habemus_papadum_gcp-0.4.0.tar.gz (192.3 kB view details)

Uploaded Source

Built Distribution

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

habemus_papadum_gcp-0.4.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file habemus_papadum_gcp-0.4.0.tar.gz.

File metadata

  • Download URL: habemus_papadum_gcp-0.4.0.tar.gz
  • Upload date:
  • Size: 192.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for habemus_papadum_gcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 262f0f9c970614e526a586f55e914eb6f85bd0f73743a71fc5dadafc33394160
MD5 36d3235862dbcf838570c9a83c35fa17
BLAKE2b-256 ed2026790b292e7048e26241900bc6e92cc4cbc3defa3370ddcf6c41e84003e5

See more details on using hashes here.

File details

Details for the file habemus_papadum_gcp-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for habemus_papadum_gcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78648cf68a60ff2b355fd4b3273551b100bfe68adb59791652db8f8fcb64929b
MD5 99370feced795287d00f57f1c8b49010
BLAKE2b-256 bac5a10b9aae77e6c2f9e9b8a70cfd1ce629dcd33b2fd9cfcbef21f0b7a43ac2

See more details on using hashes here.

Supported by

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