Skip to main content

Bindings for Podman RESTful API

Project description

podman-py

Build Status

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-4.8.1.tar.gz (77.1 kB view details)

Uploaded Source

Built Distribution

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

podman-4.8.1-py3-none-any.whl (93.1 kB view details)

Uploaded Python 3

File details

Details for the file podman-4.8.1.tar.gz.

File metadata

  • Download URL: podman-4.8.1.tar.gz
  • Upload date:
  • Size: 77.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.6

File hashes

Hashes for podman-4.8.1.tar.gz
Algorithm Hash digest
SHA256 3cb5a0bfb6cd81904ee86a6ae9915b1aa709d55d91ba40ae181f78708dafcbcb
MD5 6445425523448b41e9e085031218494e
BLAKE2b-256 6c3479c484e7b9ce4525587c75655f1cb3fa875f8c7e657f59c5751d741c050e

See more details on using hashes here.

File details

Details for the file podman-4.8.1-py3-none-any.whl.

File metadata

  • Download URL: podman-4.8.1-py3-none-any.whl
  • Upload date:
  • Size: 93.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.6

File hashes

Hashes for podman-4.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dec95a7c67d7967e0b9e164facab15fec6d2603142be10bb018657fb8715a2f
MD5 51dbfeefa363c8b6d92d502c67310d5c
BLAKE2b-256 57a87d3e99a0df952ca9c873eb94d5419349a5c3cc10e1338d226a4b939ce695

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