skillfed

openshift-client

OpenShift python client

openshift-client v2.0.5 184.1K downloads/30d#10,045 on PyPI86
Permissive license Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) DORMANT released

What it is and what it does

openshift-client is a Python wrapper around the OpenShift oc command-line tool that lets you programmatically query and manage cluster resources. Instead of making direct REST API calls, it invokes oc commands and parses their output, making it accessible to anyone familiar with the CLI. The library centers on selectors—a concept for querying collections of resources by kind, name, or label—and APIObject instances that represent individual resources and expose convenience methods for common operations like reading logs or modifying metadata.

The package is designed for automation scripts and tools that need to interact with OpenShift clusters without adding external dependencies to the cluster itself. It trades some capabilities (like watch functionality or fine-grained error codes) for simplicity and portability. If your use case fits within CLI-level interactions—querying resources, applying changes, gathering logs—this library provides a readable, fluent API. If you need controller-like behavior or precise HTTP error handling, the documentation suggests looking elsewhere.

Use it for:

  • Automate pod log collection and analysis across multiple projects in a cluster.
  • Write deployment or scaling scripts that query and modify OpenShift resources by selector.
  • Build monitoring or reporting tools that gather resource metadata and status from a running cluster.
  • Manage custom resources (CRDs) without needing to generate or maintain Python bindings.
  • Run cluster administration tasks from a bastion host via SSH without installing additional cluster software.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python API for interacting with OpenShift clusters by wrapping the oc command-line tool, enabling programmatic resource selection, querying, and management without requiring direct REST API calls.

Yes, if you need to automate OpenShift cluster operations from Python and already have oc installed and configured. The low install friction, permissive license, and stable API make it a practical choice for scripting and one-off automation. No, if you need watch functionality, precise HTTP error codes, or expect active maintenance—the package is dormant and explicitly not designed for controller-like workloads.

Install

openshift-client on PyPI

pip

pip install openshift-client

uv

uv add openshift-client

poetry

poetry add openshift-client

Installing openshift-client

Before you install

Low install friction with three lightweight runtime dependencies (build, six, pyyaml). Maintenance is dormant—last release was 617 days ago, though the repository remains active with a recent commit on 2025-01-09 and 86 stars. Suitable for stable use cases but expect no rapid updates.

License in practice

Licensed under Apache License 2.0 (permissive). You may use, modify, and distribute the package freely in commercial and private projects, provided you include a copy of the license and note any changes you make.

Quickstart

pip install openshift-client

import openshift_client as oc

with oc.project('my-project'):
    pods = oc.selector('pods').qnames()
    print(f'Found pods: {pods}')

Requires the oc command-line tool to be installed and accessible in your system PATH, and a configured connection to an OpenShift cluster (typically via prior `oc login`).

Verify before relying

  • Whether the package supports watch functionality or only one-shot CLI invocations as documented.
  • Performance characteristics when selecting or operating on large numbers of resources.
  • Compatibility with OpenShift versions released after the last package update in December 2024.

Package facts

License Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.0)
Install friction low — pure-Python wheel
Runtime dependencies 3 — build, six, pyyaml
Maintenance dormant — 617 days since the last release
Last repo commit
First released
Downloads 184,086/month — #10,045 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openshift_client-2.0.5-py3-none-any.whl

Keywords: OpenShift

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.12Topic :: Utilities

Tags

openshift cluster management pythonoc command wrapper pythonopenshift resource automationkubernetes openshift cli clientopenshift pod deployment scripting
openshiftkubernetes-adjacentcli-wrapper

More Utilities packages