- Notifications
You must be signed in to change notification settings - Fork124
Python bindings for Podman's RESTful API
License
NotificationsYou must be signed in to change notification settings
containers/podman-py
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This python package is a library of bindings to use the RESTful API ofPodman.It is currently under development and contributors are welcome!
pip install podmanDocumentation:https://podman-py.readthedocs.io/en/latest/
Source Code:https://github.com/containers/podman-py
- For runtime dependencies, see [dependencies] inpyproject.toml
- For testing and development dependencies, see [project.optional.dependencies] inpyproject.toml
- The package is split in [progress_bar], [docs], and [test]
"""Demonstrate PodmanClient."""importjsonfrompodmanimportPodmanClient# 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"withPodmanClient(base_url=uri)asclient:version=client.version()print("Release: ",version["Version"])print("Compatible API: ",version["ApiVersion"])print("Podman API: ",version["Components"][0]["Details"]["APIVersion"],"\n")# get all imagesforimageinclient.images.list():print(image,image.id,"\n")# find all containersforcontainerinclient.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 fieldsprint(sorted(container.attrs.keys()))print(json.dumps(client.df(),indent=4))
About
Python bindings for Podman's RESTful API
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.