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 Bors enabled

This python package is a library of bindings to use the RESTful API of 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(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():
        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.2.1.zip (73.7 kB view details)

Uploaded Source

Built Distribution

podman_py-3.1.2.1-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: podman-py-3.1.2.1.zip
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.4

File hashes

Hashes for podman-py-3.1.2.1.zip
Algorithm Hash digest
SHA256 82db851781cc7c0d8850fb297b42e0ba6773a90288d8f379223ac9f1efb4131d
MD5 2d01fcec04f20008d18c8ea9903b226d
BLAKE2b-256 0b3ea7170a183706a7738bb4cbeab8684edad74b314b4fd130b3180fb2c72a0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: podman_py-3.1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 69.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.4

File hashes

Hashes for podman_py-3.1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b901771bf5f5ef6cf627e92e2c3d5b2f66750dce274e31bc1953050a4eb352a
MD5 88fc45b095ba8d2bf9810782f2fcfc77
BLAKE2b-256 c55d17c633c8497236c39ad5369db112e6408003b4fae759682dcdbec8ecaae3

See more details on using hashes here.

Supported by

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