Skip to main content

Bindings for Podman RESTful API

Reason this release was yanked:

Moved to https://pypi.org/project/podman/

Project description

podman-py Build Status

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

Dependencies

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(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():
        first_name = container['Names'][0]
        container = client.containers.get(first_name)
        print(container, container.id, "\n")

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

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

Contributing

See CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

podman-py-3.1.1.3.zip (68.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

podman_py-3.1.1.3-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

Details for the file podman-py-3.1.1.3.zip.

File metadata

  • Download URL: podman-py-3.1.1.3.zip
  • Upload date:
  • Size: 68.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for podman-py-3.1.1.3.zip
Algorithm Hash digest
SHA256 0f5ffceea64992959437d581b9f3666846b5abd092c13bea4ea93132c6daa44c
MD5 607599b63ccda536580208d813b3de63
BLAKE2b-256 9c02e634ea05b61d78d6b9312bd510d32de52d7edb174232b9c5aa5a05410a79

See more details on using hashes here.

File details

Details for the file podman_py-3.1.1.3-py3-none-any.whl.

File metadata

  • Download URL: podman_py-3.1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 64.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for podman_py-3.1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7272c5ebc879c278ec4e2ae0fc2ade132a54d886e7f993b7d6939f69b617f42d
MD5 f1cb836f0c81521673555a02433fda51
BLAKE2b-256 fcb05ce273eefc75dc152b3dad921d89489ce3444a518089b0bb9016bb5c4b75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page