zhmcclient - A pure Python client library for the IBM Z HMC Web Services API
Overview
The zhmcclient package is a client library written in pure Python that interacts with the Web Services API of the Hardware Management Console (HMC) of IBM Z or LinuxONE machines. The goal of this package is to make the HMC Web Services API easily consumable for Python programmers.
The HMC Web Services API is the access point for any external tools to manage the IBM Z or LinuxONE platform. It supports management of the lifecycle and configuration of various platform resources, such as partitions, CPU, memory, virtual switches, I/O adapters, and more.
The zhmcclient package encapsulates both protocols supported by the HMC Web Services API:
- REST over HTTPS for request/response-style operations driven by the client. Most of these operations complete synchronously, but some long-running tasks complete asynchronously.
- JMS (Java Messaging Services) for notifications from the HMC to the client. This can be used to be notified about changes in the system, or about completion of asynchronous tasks started using REST.
Installation
The quick way:
$ pip install zhmcclient
For more details, see the Installation section in the documentation.
Quickstart
The following example code lists the partitions on CPCs in DPM mode that are accessible for the user:
#!/usr/bin/env python
import zhmcclient
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
# Set these variables for your environment:
host = "<IP address or hostname of the HMC>"
userid = "<userid on that HMC>"
password = "<password of that HMC userid>"
verify_cert = False
session = zhmcclient.Session(host, userid, password, verify_cert=verify_cert)
client = zhmcclient.Client(session)
console = client.consoles.console
partitions = console.list_permitted_partitions()
for part in partitions:
cpc = part.manager.parent
print("{} {}".format(cpc.name, part.name))
Possible output when running the script:
P000S67B PART1
P000S67B PART2
P0000M96 PART1
Documentation and Change Log
For the latest released version on PyPI:
zhmc CLI
Before version 0.18.0 of the zhmcclient package, it contained the zhmc CLI. Starting with zhmcclient version 0.18.0, the zhmc CLI has been moved from this project into the new zhmccli project.
If your project uses the zhmc CLI, and you are upgrading the zhmcclient package from before 0.18.0 to 0.18.0 or later, your project will need to add the zhmccli package to its dependencies.
Contributing
For information on how to contribute to this project, see the Development section in the documentation.
License
The zhmcclient package is licensed under the Apache 2.0 License.
Metadata
Release files for zhmcclient 1.26.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zhmcclient-1.26.0.tar.gz | 782.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zhmcclient-1.26.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / zhmcclient-1.26.0.tar.gz
| Download URL | zhmcclient-1.26.0.tar.gz |
|---|---|
| Size | 782.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ae1715050328009fb4eb15933d12156368a6d3189608ea85ffaded386d84757
|
|
BLAKE2b-256 checksum How to use checksums |
afff262bd9e4df99212001393864b558a81788e3ef1fc07da7a9dbad86371655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency logRelease files / zhmcclient-1.26.0-py3-none-any.whl
| Download URL | zhmcclient-1.26.0-py3-none-any.whl |
|---|---|
| Size | 380.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
530dde97bd0596c6e981aaa915687bf145bfd144a4e8525a311dcdf93d414833
|
|
BLAKE2b-256 checksum How to use checksums |
54572157214818407a303336ed3bd89fd8da800ec4a9171d68446c97651c273b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency log