No description
  • Python 93.7%
  • Shell 5.4%
  • Makefile 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel J Walsh 838727e32e
Merge pull request #90 from rhatdan/deprecated
Announce that this repo is now deprecated.
2020-10-02 16:04:29 -04:00
examples Remove pypodman to python-pypodman repo 2019-03-27 11:25:31 -07:00
podman Merge pull request #73 from 4383/1.6.1 2020-07-20 13:54:19 -07:00
test Fix overlong line in test_images.py 2020-01-05 17:37:43 +00:00
tests/libs Introduce mocked unit tests. 2019-08-14 17:22:04 +02:00
tools Introduce tools to check if implementation is properly synchronized with 2020-02-13 11:09:09 +01:00
.gitignore add missing bits 2019-01-10 15:47:25 -07:00
.pylintrc Remove pypodman to python-pypodman repo 2019-03-27 11:25:31 -07:00
.travis.yml Introduce tools to check if implementation is properly synchronized with 2020-02-13 11:09:09 +01:00
AUTHORS Fix pypi deployment by using documentation at markdown format 2019-07-03 10:54:05 +02:00
ChangeLog Fix pypi deployment by using documentation at markdown format 2019-07-03 10:54:05 +02:00
CHANGES.txt Remove pypodman to python-pypodman repo 2019-03-27 11:25:31 -07:00
CODE-OF-CONDUCT.md Add Code of Conduct 2020-02-08 18:03:16 -05:00
LICENSE Initial commit 2019-01-09 16:26:03 -05:00
Makefile More packaging 2019-07-01 11:37:45 -07:00
MANIFEST.in Remove pypodman to python-pypodman repo 2019-03-27 11:25:31 -07:00
README.md Update README.md 2020-10-02 16:03:51 -04:00
requirements.txt ModuleNotFoundError: No module named 'pbr' 2019-08-02 17:55:25 +05:30
SECURITY.md Add Security Policy 2020-05-09 18:04:18 -04:00
setup.cfg Drop py34 support 2020-02-13 11:09:09 +01:00
setup.py Fix up pushing to pypi 2019-06-28 10:54:15 -07:00
test-requirements.txt Improve testing 2019-07-18 18:15:50 +02:00
tox.ini Drop py34 support 2020-02-13 11:09:09 +01:00

podman - pythonic library for working with varlink interface to Podman

Build Status PyPI PyPI - Python Version PyPI - Status

Status: Deprecated

See podman-py

Overview

Python podman library.

Provide a stable API to call into.

Notice: The varlink interface to Podman is currently deprecated and in maintenance mode. Podman version 2.0 was released in June 2020, including a fully supported REST API that replaces the varlink interface. The varlink interface is being removed from Podman at the 3.0 release. Python support for the 2.0 REST API is in the python-py repository. The documentation for the REST API resides here.

Releases

Requirements

Install

From pypi

Install python-podman to the standard location for third-party Python modules:

python3 -m pip install podman

To use this method on Unix/Linux system you need to have permission to write to the standard third-party module directory.

Else, you can install the latest version of python-podman published on pypi to the Python user install directory for your platform. Typically ~/.local/. (See the Python documentation for site.USER_BASE for full details.) You can install like this by using the --user option:

python3 -m pip install --user podman

This method can be useful in many situations, for example, on a Unix system you might not have permission to write to the standard third-party module directory. Or you might wish to try out a module before making it a standard part of your local Python installation. This is especially true when upgrading a distribution already present: you want to make sure your existing base of scripts still works with the new version before actually upgrading.

For further reading about how python installation works you can read this documentation.

By building from source

To build the podman egg and install as user:

cd ~/python-podman
python3 setup.py clean -a && python3 setup.py sdist bdist
python3 setup.py install --user

Code snippets/examples:

Show images in storage

import podman

with podman.Client() as client:
  list(map(print, client.images.list()))

Show containers created since midnight

from datetime import datetime, time, timezone

import podman

midnight = datetime.combine(datetime.today(), time.min, tzinfo=timezone.utc)

with podman.Client() as client:
    for c in client.containers.list():
        created_at = podman.datetime_parse(c.createdat)

        if created_at > midnight:
            print('Container {}: image: {} created at: {}'.format(
                c.id[:12], c.image[:32], podman.datetime_format(created_at)))