Skip to main content

helm-python-sdk — Helm v4 SDK for Python

CI Wheels License: Apache-2.0 Python helm-c-sdk Helm SDK Platforms Zero runtime deps

Use Helm from Python: load and render charts, talk to OCI registries, and install/upgrade/roll back releases — without the helm binary, a Go toolchain, or a compiler.

It binds to libhelm_c (a C ABI over Helm's official Go SDK) using ctypes from the standard library, so the package itself has zero runtime dependencies.

Status: early development, feature-complete API. Charts, distribution, the release lifecycle, logging, and platform wheels all work. See PLAN.md for what remains before a public release.

Install

pip install helm-python-sdk

The import name is helm_python.

The wheel bundles the native library for your platform, so nothing is compiled at install time and no environment variables need to be set.

If no wheel matches your platform

Three options, resolved in this order:

  1. Point at your own build — build helm-c-sdk (make build, works anywhere Go runs) and set:

    export HELM_C_LIB=/path/to/libhelm_c.so     # or .dylib / .dll, or its directory
    
  2. Build during install — requires Go and a C compiler:

    HELM_PYTHON_BUILD=1 pip install --no-binary helm-python-sdk helm-python-sdk
    

    The source distribution vendors the pinned helm-c-sdk source, so nothing unpinned is fetched. The installer checks for Go, a C compiler, and make first and names exactly what is missing rather than failing with a compiler error.

  3. Prebuilt wheel — the default when your platform is in the release matrix.

Usage

import helm_python as helm

with helm.Chart.load("./mychart") as chart:
    chart.name, chart.version  # 'mychart', '0.1.0'
    chart.values  # default values as a dict
    chart.merge_values({"replicaCount": 3})  # what an install would really use

    manifests = chart.render({"replicaCount": 3}, name="demo", namespace="prod")
    print(manifests["mychart/templates/deployment.yaml"])

    chart.validate_schema({"replicaCount": 3})  # against values.schema.json, if present
    chart.save("./dist")  # -> ./dist/mychart-0.1.0.tgz

Charts are handles into the native library. Use them as context managers (above) or call close(); a forgotten chart is still released when it is garbage collected, and closing twice is safe.

Module-level chart helpers:

helm.lint("./mychart")  # findings are data, not exceptions
helm.package("./mychart", destination="./dist", version="1.2.3")
helm.verify("./dist/mychart-1.2.3.tgz", keyring="~/.gnupg/pubring.gpg")

helm.validate_release_name("my-release")  # raises HelmInvalidArgError if unusable
helm.parse_set_string("image.tag=v2,ports={80,443}")
# {'image': {'tag': 'v2'}, 'ports': [80, 443]}

print(helm.helm_c_version(), helm.helm_sdk_version())  # 0.2.1 v4.2.3

Registries, repositories, and dependencies:

# HTTP chart repositories
helm.repo_index("https://charts.example.com")
helm.pull("mychart", repo_url="https://charts.example.com", destination="./dist")

# OCI registries
with helm.RegistryClient() as client:
    client.login("registry.example.com", "user", "token")
    client.push("./dist/mychart-1.0.0.tgz", "oci://registry.example.com/charts")
    client.pull("oci://registry.example.com/charts/mychart", destination="./dist")

# Dependencies — no `helm repo add` needed; your Helm config is untouched
helm.dependency_update("./mychart")
helm.dependency_build("./mychart")

Releases:

with helm.Config(namespace="default") as cfg:  # ~/.kube/config, or in-cluster
    release = cfg.install("./mychart", "demo", {"replicaCount": 3}, wait="watcher", timeout=120)
    print(release["revision"], release["status"])  # 1 deployed

    cfg.upgrade("./mychart", "demo", {"replicaCount": 5})
    cfg.history("demo")  # every revision
    cfg.get_values("demo")  # {'replicaCount': 5}
    cfg.rollback("demo", version=1)
    cfg.uninstall("demo")

    for item in cfg.list():
        print(item["name"], item["revision"], item["status"])

Long operations can be cancelled from another thread:

ctx = helm.HelmContext()
threading.Timer(30, ctx.cancel).start()
try:
    cfg.install(chart, "demo", context=ctx, wait="watcher", timeout=300)
except helm.HelmCancelledError:
    ...

Config accepts the whole Kubernetes connection surface — kubeconfig_path or inline kubeconfig_content, kube_context, bearer kube_token, kube_apiserver, CA/TLS settings, impersonation, throttling, namespace, and storage_driver (secret, configmap, memory, sql).

Errors are a typed hierarchy rooted at HelmError, mapped from the ABI's error codes, and several also subclass familiar builtins so existing except clauses keep working:

try:
    helm.parse_set_string("a=1,,=x=")
except helm.HelmValuesError as exc:  # also a ValueError
    print(exc.code, exc.detail)

Logging

The library is silent until you ask for output:

import logging, helm_python as helm

logging.basicConfig(level=logging.INFO)
helm.enable_logging(logging.INFO)  # call before creating a Config
...
helm.disable_logging()

Records arrive on the helm_python.native logger, so they filter and route like any other Python logging. Callbacks arrive on library threads; nothing can propagate back into the native code, so a broken handler cannot crash the process.

Why no library-path configuration is needed

The library is always loaded by absolute path — from inside the installed package, or from HELM_C_LIB — never by bare name through the OS loader search path. Nothing needs to be added to LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH, moving a virtualenv does not break imports, and installing this package never modifies your system configuration.

Development

pip install -e ".[dev]"
python scripts/check_native_table.py ../helm-c/include/helm_c.h   # signature drift gate
pytest                                                            # includes the leak gate
ruff check . && ruff format --check . && mypy

Tests locate a sibling helm-c checkout's build/ directory automatically; otherwise set HELM_C_LIB.

Releasing

Wheels must be built from the source tree, not from the sdist, or the bundled library is dropped:

python scripts/fetch_native_lib.py --release v0.2.1   # or --from-dir ../helm-c/build
python -m build --wheel                               # NOT `python -m build`
python scripts/tag_wheel.py dist/*.whl                # refuses a wheel with no library

CI does this per platform and smoke-tests every wheel in a clean virtualenv.

License

Apache-2.0. Copyright 2026 Shivam Kumar.

Download files

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

Source Distribution

helm_python_sdk-0.2.1.tar.gz (225.5 kB view details)

Uploaded Source

Built Distributions

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

helm_python_sdk-0.2.1-py3-none-win_amd64.whl (71.5 MB view details)

Uploaded Python 3Windows x86-64

helm_python_sdk-0.2.1-py3-none-manylinux_2_28_x86_64.whl (75.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

helm_python_sdk-0.2.1-py3-none-macosx_11_0_arm64.whl (63.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file helm_python_sdk-0.2.1.tar.gz.

File metadata

  • Download URL: helm_python_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 225.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for helm_python_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7dd15f0a24a732aeed5b0b043c7245724add386cb584a9170d3a9ae4b96281f0
MD5 870c9b53ac94e659ebe1cd3a92efb16f
BLAKE2b-256 051ce274b5f22c055356cef978ab67b820964930b5c71b5f60caf76ff9007bdc

See more details on using hashes here.

Provenance

The following attestation bundles were made for helm_python_sdk-0.2.1.tar.gz:

Publisher: wheels.yml on shivamkumar99/helm-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helm_python_sdk-0.2.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for helm_python_sdk-0.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ccc7de26becc6c3822f0d5da39b15b13d6427a63a9a984a4ea13fc7baddcd63b
MD5 9b23aeb3ac41e4f78e9017cecce33ff5
BLAKE2b-256 f991a6c904f3db81b90077cc4edd7a07644cf642ee287b61da73aff5b32f0a20

See more details on using hashes here.

Provenance

The following attestation bundles were made for helm_python_sdk-0.2.1-py3-none-win_amd64.whl:

Publisher: wheels.yml on shivamkumar99/helm-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helm_python_sdk-0.2.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for helm_python_sdk-0.2.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 93eae2be245fdd66454bb8d0607a83ca42913d49370c2b90f6f891b542254794
MD5 678b416327e8a6d7d97b9e47a46a36ce
BLAKE2b-256 d7455de08c41faf2fb9278db6a0302ee044604f0281838ae2a2a140f3c5e788c

See more details on using hashes here.

Provenance

The following attestation bundles were made for helm_python_sdk-0.2.1-py3-none-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on shivamkumar99/helm-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helm_python_sdk-0.2.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for helm_python_sdk-0.2.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23ad2583bd0d7a287f1b201b868c6c5699be197981745f2f974af8d34a5ffb5d
MD5 02e1a06a83a97b2ab1fa1623bfeb4670
BLAKE2b-256 bc7ea0ca717ef39c869b20ddc4bf1de8b9555950a487d502d6bebdc2ce278aa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for helm_python_sdk-0.2.1-py3-none-macosx_11_0_arm64.whl:

Publisher: wheels.yml on shivamkumar99/helm-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.2

6 files

This release

0.2.1 This release

4 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