liveBook · Manning

Podman-py

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

The python-podman package is a distributable package that installs the podman-py Python client library.

podman-py is a Python bindings library for communicating with the Podman service through the Libpod API. The distributable package is installed as python-podman. section 9.3 section 9.3.2

Use podman-py when Python code needs Podman’s advanced features, including pod management. It connects automatically to the default rootless or rootful Podman socket. section 9.3.2 section 9.3.3

Install and list images

Install the package with `sudo dnf install -y python-podman`, then create a client with `podman.PodmanClient()` and list images through `client.images.list()`. The same client can enumerate pods and print each pod’s attributes.

Table 9.4 Podman-py vs. docker-py (view table figure)

Support

Podman-py

Docker-py

Podman service

✔

✔

Docker daemon

✘

✔

Supports pods

✔

✘

Advanced Podman features

✔

✘

Compare podman-py and docker-py across Podman service access, Docker daemon compatibility, pod support, and advanced Podman features. section 9.3.3

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains installation, client creation, socket selection, image listing, pod inspection, and library choice without detailing API internals.
Examples
Uses package installation, an image-listing script, image output, and pod attribute inspection.
What it assumes
Assumes limited Python knowledge while teaching package installation, client construction, default sockets, and the podman-py versus docker-py choice.
What you can do after
Build scripts with podman-py that list images, inspect pods, and access advanced Podman features through the service.
How it connects
Connects Python, the Podman service, the Libpod API, Docker compatibility, docker-py, REST APIs, and rootless or rootful operation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.