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!
Installation
pip install podman
Documentation: https://podman-py.readthedocs.io/en/latest/
Source Code: https://github.com/containers/podman-py
Dependencies
- For runtime dependencies, see [dependencies] in pyproject.toml
- For testing and development dependencies, see [project.optional.dependencies] in pyproject.toml
- The package is split in [progress_bar], [docs], and [test]
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():
# 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 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
Built Distribution
File details
Details for the file podman-5.4.0.1.tar.gz
.
File metadata
- Download URL: podman-5.4.0.1.tar.gz
- Upload date:
- Size: 68.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee537aaa44ba530fad7cd939d886a7632f9f7018064e7831e8cb614c54cb1789 |
|
MD5 | b765273fd674c1b38ea4ba31059ce342 |
|
BLAKE2b-256 | fa5cff701e438360a526a728eae3c18ee439c0875e4b937947f1cd04497ae17e |
Provenance
The following attestation bundles were made for podman-5.4.0.1.tar.gz
:
Publisher:
publish-to-test-pypi.yml
on containers/podman-py
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
podman-5.4.0.1.tar.gz
- Subject digest:
ee537aaa44ba530fad7cd939d886a7632f9f7018064e7831e8cb614c54cb1789
- Sigstore transparency entry: 172502350
- Sigstore integration time:
- Permalink:
containers/podman-py@2a29132efab4a183580a30d9c18b9bdb61b5ab49
- Branch / Tag:
refs/tags/v5.4.0.1
- Owner: https://github.com/containers
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish-to-test-pypi.yml@2a29132efab4a183580a30d9c18b9bdb61b5ab49
- Trigger Event:
push
- Statement type:
File details
Details for the file podman-5.4.0.1-py3-none-any.whl
.
File metadata
- Download URL: podman-5.4.0.1-py3-none-any.whl
- Upload date:
- Size: 84.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abd32e49a66bf18a680d9a0ac3989a3f4a3cc7293bc2a5060653276d8ee712f4 |
|
MD5 | e5d1507244822271dc935c44b0a16ab1 |
|
BLAKE2b-256 | 8e386d4416f3ec8dc18149847bbb31cc54af20de063844029b00fb0c0d4c533c |
Provenance
The following attestation bundles were made for podman-5.4.0.1-py3-none-any.whl
:
Publisher:
publish-to-test-pypi.yml
on containers/podman-py
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
podman-5.4.0.1-py3-none-any.whl
- Subject digest:
abd32e49a66bf18a680d9a0ac3989a3f4a3cc7293bc2a5060653276d8ee712f4
- Sigstore transparency entry: 172502351
- Sigstore integration time:
- Permalink:
containers/podman-py@2a29132efab4a183580a30d9c18b9bdb61b5ab49
- Branch / Tag:
refs/tags/v5.4.0.1
- Owner: https://github.com/containers
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish-to-test-pypi.yml@2a29132efab4a183580a30d9c18b9bdb61b5ab49
- Trigger Event:
push
- Statement type: