Bindings for Podman RESTful API
Project description
podman-py
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
- For runtime dependencies, see requirements.txt.
- For testing and development dependencies, see test-requirements.txt.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
podman-3.1.2.4.linux-x86_64.tar.gz
(109.0 kB
view hashes)
Built Distribution
podman-3.1.2.4-py3-none-any.whl
(69.0 kB
view hashes)
Close
Hashes for podman-3.1.2.4.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f674193f7c85ea2f53e465f73466ced3bc7b959d26f06dd792611a9411e70b51 |
|
MD5 | 7fe89120bc6a882f5e8a07996b8159c0 |
|
BLAKE2b-256 | fa877c05405eee84754c009f01f21f529fc6d640e3a5e6cda87a9c697e141055 |