Shared platform Python library (AWS/Cloudflare/Kubernetes/Vault utilities + core helpers).
Note
This README is written in an “open-source style” so it’s easy to onboard and reuse across multiple projects.
- What this is
- Scope and non-goals
- Installation
- Quickstart
- Modules
- Development
- Contributing
- Security
- License
platform-core is a small Python library intended to reduce copy/paste across internal tooling by
providing:
- AWS helpers (client config, common patterns)
- Cloudflare helpers (API session, pagination, retries/backoff)
- Vault helpers (KV v2 read/write with timeouts)
- Kubernetes helpers (optional client initialization)
- Core utilities (logging + small helpers)
- In scope
- Minimal, dependency-light helpers with sane defaults (timeouts, retries)
- Code that is reusable across multiple repos and teams
- Prefer explicit, boring interfaces over “framework magic”
- Non-goals
- Product/business logic
- Infrastructure-as-code (Terraform/CloudFormation) tooling (unless/ until it actually lives here)
- A grab-bag of unrelated helpers
Python: 3.14+
Tip
For local development, use editable installs so you can iterate quickly.
python3 -m pip install -U pip
python3 -m pip install -e .Optional extras:
# Kubernetes client helpers
python3 -m pip install -e ".[kubernetes]"from platform_core.aws import AWSUtils
aws = AWSUtils()
sts = aws.create_boto3_client("sts", "us-east-1")
print(sts.get_caller_identity()["Account"])import os
from platform_core.cloudflare import cloudflare_api_session
with cloudflare_api_session(os.environ["CLOUDFLARE_API_TOKEN"]) as api:
zones = api.make_api_request("GET", "/zones")
print(zones)import os
from platform_core.vault import VaultClient
client = VaultClient(vault_addr=os.environ["VAULT_ADDR"])
data = client.read_credentials(secrets_engine="secret", secret_path="team/app/credentials")
print(data)from platform_core.kubernetes import create_api_client
api_client = create_api_client()
# Requires: python3 -m pip install -e ".[kubernetes]"
from kubernetes import client as k8s_client
v1 = k8s_client.CoreV1Api(api_client)
print([ns.metadata.name for ns in v1.list_namespace().items])platform_core.utils- Core helpers (logging, JSON, env, string utilities)
platform_core.awsAWSUtilsand helper managers (DynamoDB/SQS)
platform_core.cloudflareCloudflareAPI+cloudflare_api_session- Bounded retries for transient errors (429/5xx/408) with backoff
platform_core.vaultVaultClientfor KV v2 secret read/write with HTTP timeouts
platform_core.kubernetescreate_api_client()(in-cluster config, else kubeconfig)
python3 -m pip install pre-commit
pre-commit install
# Update hook versions
pre-commit autoupdate
# Run checks
pre-commit run --all-filesCI runs the same checks on every PR/push via GitHub Actions.
See .github/CONTRIBUTING.md.
- Do not commit secrets (tokens, keys, credentials)
ggshieldruns onpre-push(setGITGUARDIAN_API_KEYto enable)- Prefer least privilege for AWS and Cloudflare tokens
See LICENSE.md.
src/platform_core/utils.py: logging + core helperssrc/platform_core/aws.py: AWS helperssrc/platform_core/cloudflare.py: Cloudflare API helperssrc/platform_core/vault.py: Vault helpers