pykube-ng
Python client library for Kubernetes
What it is and what it does
pykube-ng is a lightweight Python client for Kubernetes that wraps the Kubernetes API in native Python objects. It uses requests for HTTP communication and kubeconfig for authentication, allowing you to query, filter, create, and delete Kubernetes resources (Pods, Deployments, Jobs, etc.) programmatically. The library exposes Kubernetes objects as Python classes with methods for common operations like filtering by namespace or selector, watching for changes, and accessing raw API attributes.
The package is a maintained fork of the original pykube project, which was archived. It supports Python 3.8 through 3.10 and depends on urllib3, pyyaml, and requests. While it provides a simpler, more Pythonic interface than direct API calls, it is no longer actively maintained—the last release was over 1155 days ago, so compatibility with recent Kubernetes versions and security updates are not guaranteed.
Use it for:
- Programmatically query and filter Kubernetes resources (pods, deployments, jobs) by namespace, label, or field selector.
- Automate Kubernetes resource creation and deletion (e.g., spinning up deployments or cleaning up jobs) from Python scripts.
- Watch Kubernetes resources for changes in real time and react to ADDED, MODIFIED, or DELETED events.
- Build Python-based tools or operators that need to interact with a Kubernetes cluster without shelling out to kubectl.
- Access raw Kubernetes object attributes and metadata through a Python object interface.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pykube-ng is a Python client library for querying, creating, and managing Kubernetes API objects through a native Python interface backed by requests and kubeconfig authentication.
Yes, with conditions. pykube-ng is stable and has low install friction, making it suitable for existing projects or scripts that already depend on it. However, do not adopt it for new projects: the package is abandoned (no releases in 1155+ days), so it will not receive security patches or updates for newer Kubernetes API versions. For new work, consider the actively maintained official Kubernetes Python client (kubernetes) instead.
Install
pykube-ng on PyPI
pip
pip install pykube-nguv
uv add pykube-ngpoetry
poetry add pykube-ngInstalling pykube-ng
Before you install
Low install friction with only three runtime dependencies (urllib3, pyyaml, requests). However, the package is marked abandoned with no releases for over 1155 days, so maintenance and security updates are not expected.
License in practice
Licensed under Apache License 2.0, a permissive open-source license that allows use in commercial and private projects with minimal restrictions.
Quickstart
pip install pykube-ng
import pykube
api = pykube.HTTPClient(pykube.KubeConfig.from_file())
pods = pykube.Pod.objects(api).filter(namespace="default")
for pod in pods:
print(pod.name)
Requires Python 3.8 or later and a valid kubeconfig file (typically ~/.kube/config) to authenticate with a Kubernetes cluster.
Verify before relying
- Whether the package works with recent Kubernetes API versions given the 1155+ day gap since last release.
- Current status of the upstream repository and whether security patches are backported or planned.
Package facts
| License | Apache (permissive) |
| Python support | supports the current Python release (>=3.8,<4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — urllib3, pyyaml, requests |
| Maintenance | abandoned — 1,155 days since the last release |
| First released | |
| Downloads | 252,860/month — #8,531 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pykube_ng-23.6.0-py3-none-any.whl
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
kr8sA Python client library for Kubernetes that…
permissive · top 5,000 on PyPI
portforwardProvides Python bindings for Kubernetes…
permissive · top 15,000 on PyPI
kubernetes-asyncioAsynchronous Python client for the Kubernetes…
permissive · top 5,000 on PyPI
kubernetesProvides a Python interface to the Kubernetes…
permissive · top 1,000 on PyPI
pyhelm3pyhelm3 is a Python library for…
permissive · top 15,000 on PyPI
openshiftPython client library for interacting with…
permissive · top 15,000 on PyPI
pulumi-kubernetesPulumi Kubernetes Resource Provider lets you…
permissive · top 5,000 on PyPI
k8s-agent-sandboxA Python client library for creating and…
permissive · top 15,000 on PyPI
kfp-kubernetesExtends Kubeflow Pipelines SDK with…
permissive · top 15,000 on PyPI
kubernetes-stubsProvides Python type stubs for the Kubernetes…
permissive · top 15,000 on PyPI