No description
  • Python 99.2%
  • Makefile 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Giovanni 8d5ea3a737 Add socket mode to exec_run for bidirectional streaming
Implement connection hijacking over the exec start endpoint so
exec_run(socket=True) returns the raw socket, matching docker-py's
return contract (None, socket). The response is anchored on the
socket object to prevent urllib3 from reclaiming the hijacked
connection.

Fixes #421

Signed-off-by: Giovanni <oligiovi2@gmail.com>
2026-07-20 17:36:28 +02:00
.fmf Onboard TMT 2025-01-29 16:10:30 +01:00
.github Bump release to 5.8.0 2026-03-24 15:26:56 +01:00
contrib/examples remove cirrus files 2025-06-27 17:42:59 +02:00
docs/source Fix Pyupgrades 2025-01-28 15:42:15 +01:00
plans Bump release to 5.8.0 2026-03-24 15:26:56 +01:00
podman Add socket mode to exec_run for bidirectional streaming 2026-07-20 17:36:28 +02:00
rpm Fix Pyupgrades 2025-01-28 15:42:15 +01:00
tests Improve testing against distro and podman-next 2025-05-05 15:48:40 +02:00
.gitignore [CI:BUILD] Packit: initial enablement 2023-06-05 16:06:08 -04:00
.packit.yaml TMT: update version donwstream to match release 2026-03-24 15:26:52 +01:00
.pre-commit-config.yaml Merge pull request #626 from inknos/renovate-pre-commit 2026-02-13 13:41:47 +01:00
.pylintrc Update files to adhere to new lint requirements 2023-02-07 11:46:58 -05:00
.readthedocs.yaml fix: broken configuration for readthedocs 2025-06-22 22:06:04 +02:00
AGENTS.md Add AI agent support 2026-04-30 18:43:18 +02:00
CODE-OF-CONDUCT.md [CI:DOCS] Fix docs links due to branch rename 2021-06-14 14:27:57 -04:00
CONTRIBUTING.md [docs] Update testing section 2025-09-29 14:57:17 +02:00
gating.yml Enable tmt downstream 2025-03-05 17:07:42 +01:00
LICENSE initial check'in 2020-02-03 12:34:35 -06:00
Makefile Add release PR workflow 2026-03-19 18:58:43 +01:00
MANIFEST.in Include test files in the source distribution 2025-09-09 11:02:25 +02:00
mkdocs.yml documentation skeleton 2020-11-03 22:48:34 +01:00
OWNERS Add Honn1 to OWNERS 2025-09-04 14:26:27 +02:00
podman.svg Revert pyproject.toml requires changes 2021-09-17 09:11:38 -07:00
pyproject.toml Remove deprecated mypy option 2026-04-30 18:42:46 +02:00
README.md Remove Cirrus testing 2025-05-06 10:49:43 +02:00
SECURITY.md [CI:DOCS] Fix docs links due to branch rename 2021-06-14 14:27:57 -04:00
setup.cfg Add release PR workflow 2026-03-19 18:58:43 +01:00
setup.py Lint pep-naming N80 2025-09-04 12:18:20 +02:00
tox.ini Update Ruff to 0.12.8 2025-09-04 12:18:19 +02:00

podman-py

PyPI Latest Version

This python package is a library of bindings to use the RESTful API of Podman. It is currently under development and contributors are welcome!

Installation

pip install podman

Documentation: https://podman-py.readthedocs.io/en/latest/

Source Code: https://github.com/containers/podman-py


Dependencies

  • For runtime dependencies, see [dependencies] in pyproject.toml
  • For testing and development dependencies, see [project.optional.dependencies] in pyproject.toml
    • The package is split in [progress_bar], [docs], and [test]

Example usage

"""Demonstrate PodmanClient."""
import json
from podman import PodmanClient

# Provide a URI path for the libpod service.  In libpod, the URI can be a unix
# domain socket(UDS) or TCP.  The TCP connection has not been implemented in this
# package yet.

uri = "unix:///run/user/1000/podman/podman.sock"

with PodmanClient(base_url=uri) as client:
    version = client.version()
    print("Release: ", version["Version"])
    print("Compatible API: ", version["ApiVersion"])
    print("Podman API: ", version["Components"][0]["Details"]["APIVersion"], "\n")

    # get all images
    for image in client.images.list():
        print(image, image.id, "\n")

    # find all containers
    for container in client.containers.list():
        # After a list call you would probably want to reload the container
        # to get the information about the variables such as status.
        # Note that list() ignores the sparse option and assumes True by default.
        container.reload()
        print(container, container.id, "\n")
        print(container, container.status, "\n")

        # available fields
        print(sorted(container.attrs.keys()))

    print(json.dumps(client.df(), indent=4))

Contributing

See CONTRIBUTING.md