podman


Namepodman JSON
Version 5.0.0 PyPI version JSON
download
home_pagehttps://github.com/containers/podman-py
SummaryBindings for Podman RESTful API
upload_time2024-03-22 22:05:40
maintainerNone
docs_urlNone
authorBrent Baude, Jhon Honce, Urvashi Mohnani
requires_python>=3.6
licenseApache-2.0
keywords podman libpod
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # podman-py
[![Build Status](https://api.cirrus-ci.com/github/containers/podman-py.svg)](https://cirrus-ci.com/github/containers/podman-py/main)

This python package is a library of bindings to use the RESTful API of [Podman](https://github.com/containers/podman).
It is currently under development and contributors are welcome!


## Dependencies

* For runtime dependencies, see [requirements.txt](https://github.com/containers/podman-py/blob/main/requirements.txt).
* For testing and development dependencies, see [test-requirements.txt](https://github.com/containers/podman-py/blob/main/test-requirements.txt).

## Example usage

```python
"""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](https://github.com/containers/podman-py/blob/main/CONTRIBUTING.md)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/containers/podman-py",
    "name": "podman",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "podman, libpod",
    "author": "Brent Baude, Jhon Honce, Urvashi Mohnani",
    "author_email": "jhonce@redhat.com",
    "download_url": "https://files.pythonhosted.org/packages/0c/ab/8ddc43e1b00d541dc4062f6e0161a067f397e84d129a7d758b592bef1699/podman-5.0.0.tar.gz",
    "platform": "any",
    "description": "# podman-py\n[![Build Status](https://api.cirrus-ci.com/github/containers/podman-py.svg)](https://cirrus-ci.com/github/containers/podman-py/main)\n\nThis python package is a library of bindings to use the RESTful API of [Podman](https://github.com/containers/podman).\nIt is currently under development and contributors are welcome!\n\n\n## Dependencies\n\n* For runtime dependencies, see [requirements.txt](https://github.com/containers/podman-py/blob/main/requirements.txt).\n* For testing and development dependencies, see [test-requirements.txt](https://github.com/containers/podman-py/blob/main/test-requirements.txt).\n\n## Example usage\n\n```python\n\"\"\"Demonstrate PodmanClient.\"\"\"\nimport json\nfrom podman import PodmanClient\n\n# Provide a URI path for the libpod service.  In libpod, the URI can be a unix\n# domain socket(UDS) or TCP.  The TCP connection has not been implemented in this\n# package yet.\n\nuri = \"unix:///run/user/1000/podman/podman.sock\"\n\nwith PodmanClient(base_url=uri) as client:\n    version = client.version()\n    print(\"Release: \", version[\"Version\"])\n    print(\"Compatible API: \", version[\"ApiVersion\"])\n    print(\"Podman API: \", version[\"Components\"][0][\"Details\"][\"APIVersion\"], \"\\n\")\n\n    # get all images\n    for image in client.images.list():\n        print(image, image.id, \"\\n\")\n\n    # find all containers\n    for container in client.containers.list():\n        first_name = container['Names'][0]\n        container = client.containers.get(first_name)\n        print(container, container.id, \"\\n\")\n\n        # available fields\n        print(sorted(container.attrs.keys()))\n\n    print(json.dumps(client.df(), indent=4))\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/containers/podman-py/blob/main/CONTRIBUTING.md)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Bindings for Podman RESTful API",
    "version": "5.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/containers/podman-py/issues",
        "Homepage": "https://github.com/containers/podman-py",
        "Libpod API": "https://docs.podman.io/en/latest/_static/api.html"
    },
    "split_keywords": [
        "podman",
        " libpod"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "772fd245a7a5d1c705cfd7e54af58dccc408fd5350e52ba320cff0303df10d07",
                "md5": "f9191ae4316326fad5d8cc0203ede13e",
                "sha256": "29e52a5bb10646ddf0cec34787c495dbb38851eb37cb151a62877fba34a17e8a"
            },
            "downloads": -1,
            "filename": "podman-5.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9191ae4316326fad5d8cc0203ede13e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 94084,
            "upload_time": "2024-03-22T22:05:39",
            "upload_time_iso_8601": "2024-03-22T22:05:39.048936Z",
            "url": "https://files.pythonhosted.org/packages/77/2f/d245a7a5d1c705cfd7e54af58dccc408fd5350e52ba320cff0303df10d07/podman-5.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cab8ddc43e1b00d541dc4062f6e0161a067f397e84d129a7d758b592bef1699",
                "md5": "c096e63755ad3b9ef4194d9743c9e1c9",
                "sha256": "23b5e60d8451e907b7e0aa5aca6aa52720792ec8ff0b0a74c5cc50064daa5d19"
            },
            "downloads": -1,
            "filename": "podman-5.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c096e63755ad3b9ef4194d9743c9e1c9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 78129,
            "upload_time": "2024-03-22T22:05:40",
            "upload_time_iso_8601": "2024-03-22T22:05:40.760480Z",
            "url": "https://files.pythonhosted.org/packages/0c/ab/8ddc43e1b00d541dc4062f6e0161a067f397e84d129a7d758b592bef1699/podman-5.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-22 22:05:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "containers",
    "github_project": "podman-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "podman"
}
        
Elapsed time: 0.25825s