pyportainer


Namepyportainer JSON
Version 0.1.7 PyPI version JSON
download
home_pageNone
SummaryAsynchronous Python client for the Portainer API
upload_time2025-08-26 18:52:07
maintainerErwin Douna
docs_urlNone
authorErwin Douna
requires_python<4.0,>=3.11
licenseMIT
keywords python-portainer api async client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- PROJECT SHIELDS -->
[![GitHub Release][releases-shield]][releases]
[![Python Versions][python-versions-shield]][pypi]
![Project Stage][project-stage-shield]
![Project Maintenance][maintenance-shield]
[![License][license-shield]](LICENSE)

[![GitHub Activity][commits-shield]][commits-url]
[![PyPi Downloads][downloads-shield]][downloads-url]
[![GitHub Last Commit][last-commit-shield]][commits-url]
[![Open in Dev Containers][devcontainer-shield]][devcontainer]

[![Build Status][build-shield]][build-url]
[![Typing Status][typing-shield]][typing-url]
[![Maintainability][maintainability-shield]][maintainability-url]
[![Code Coverage][codecov-shield]][codecov-url]


Asynchronous Python client for Python Portainer.

## About

This is an asynchronous Python client for the [Portainer API](https://docs.portainer.io/api-docs/). It is designed to be used with the [Portainer](https://www.portainer.io/) container management tool.
This package is a wrapper around the Portainer API, which allows you to interact with Portainer programmatically.

In it's current stage it's still in development and not all endpoints are implemented yet.

## Installation

```bash
pip install pyportainer
```

### Example

```python
import asyncio

from pyportainer import Portainer


async def main() -> None:
    """Run the example."""
    async with Portainer(
        api_url="http://localhost:9000",
        api_key="YOUR_API_KEY",
    ) as portainer:
        endpoints = await portainer.get_endpoints()
        print("Portainer Endpoints:", endpoints)


if __name__ == "__main__":
    asyncio.run(main())
```

More examples can be found in the [examples folder](./examples/).

## Contributing

This is an active open-source project. We are always open to people who want to
use the code or contribute to it.

We've set up a separate document for our
[contribution guidelines](CONTRIBUTING.md).

Thank you for being involved! :heart_eyes:

## Setting up development environment

The simplest way to begin is by utilizing the [Dev Container][devcontainer]
feature of Visual Studio Code or by opening a CodeSpace directly on GitHub.
By clicking the button below you immediately start a Dev Container in Visual Studio Code.

[![Open in Dev Containers][devcontainer-shield]][devcontainer]

This Python project relies on [Poetry][poetry] as its dependency manager,
providing comprehensive management and control over project dependencies.

You need at least:

- Python 3.11+
- [Poetry][poetry-install]

### Installation

Install all packages, including all development requirements:

```bash
poetry install
```

_Poetry creates by default an virtual environment where it installs all
necessary pip packages_.

### Pre-commit

This repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. To setup the pre-commit check, run:

```bash
poetry run pre-commit install
```

And to run all checks and tests manually, use the following command:

```bash
poetry run pre-commit run --all-files
```

### Testing

It uses [pytest](https://docs.pytest.org/en/stable/) as the test framework. To run the tests:

```bash
poetry run pytest
```

To update the [syrupy](https://github.com/tophat/syrupy) snapshot tests:

```bash
poetry run pytest --snapshot-update
```

## License

MIT License

Copyright (c) 2025 Erwin Douna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


<!-- LINKS FROM PLATFORM -->


<!-- MARKDOWN LINKS & IMAGES -->
[build-shield]: https://github.com/erwindouna/pyportainer/actions/workflows/tests.yaml/badge.svg
[build-url]: https://github.com/erwindouna/pyportainer/actions/workflows/tests.yaml
[codecov-shield]: https://codecov.io/gh/erwindouna/pyportainer/branch/main/graph/badge.svg?token=TOKEN
[codecov-url]: https://codecov.io/gh/erwindouna/pyportainer
[commits-shield]: https://img.shields.io/github/commit-activity/y/erwindouna/pyportainer.svg
[commits-url]: https://github.com/erwindouna/pyportainer/commits/main
[devcontainer-shield]: https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode
[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/erwindouna/pyportainer
[downloads-shield]: https://img.shields.io/pypi/dm/pyportainer
[downloads-url]: https://pypistats.org/packages/pyportainer
[last-commit-shield]: https://img.shields.io/github/last-commit/erwindouna/pyportainer.svg
[license-shield]: https://img.shields.io/github/license/erwindouna/pyportainer.svg
[maintainability-shield]: https://api.codeclimate.com/v1/badges/TOKEN/maintainability
[maintainability-url]: https://codeclimate.com/github/erwindouna/pyportainer/maintainability
[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
[pypi]: https://pypi.org/project/pyportainer/
[python-versions-shield]: https://img.shields.io/pypi/pyversions/pyportainer
[releases-shield]: https://img.shields.io/github/release/erwindouna/pyportainer.svg
[releases]: https://github.com/erwindouna/pyportainer/releases
[typing-shield]: https://github.com/erwindouna/pyportainer/actions/workflows/typing.yaml/badge.svg
[typing-url]: https://github.com/erwindouna/pyportainer/actions/workflows/typing.yaml

[poetry-install]: https://python-poetry.org/docs/#installation
[poetry]: https://python-poetry.org
[pre-commit]: https://pre-commit.com


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyportainer",
    "maintainer": "Erwin Douna",
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": "e.douna@gmail.com",
    "keywords": "python-portainer, api, async, client",
    "author": "Erwin Douna",
    "author_email": "e.douna@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/30/bf/fb76b363a3edb3253d9d06e2281955ddf189a3b41d7885073eaadc6e3086/pyportainer-0.1.7.tar.gz",
    "platform": null,
    "description": "<!-- PROJECT SHIELDS -->\n[![GitHub Release][releases-shield]][releases]\n[![Python Versions][python-versions-shield]][pypi]\n![Project Stage][project-stage-shield]\n![Project Maintenance][maintenance-shield]\n[![License][license-shield]](LICENSE)\n\n[![GitHub Activity][commits-shield]][commits-url]\n[![PyPi Downloads][downloads-shield]][downloads-url]\n[![GitHub Last Commit][last-commit-shield]][commits-url]\n[![Open in Dev Containers][devcontainer-shield]][devcontainer]\n\n[![Build Status][build-shield]][build-url]\n[![Typing Status][typing-shield]][typing-url]\n[![Maintainability][maintainability-shield]][maintainability-url]\n[![Code Coverage][codecov-shield]][codecov-url]\n\n\nAsynchronous Python client for Python Portainer.\n\n## About\n\nThis is an asynchronous Python client for the [Portainer API](https://docs.portainer.io/api-docs/). It is designed to be used with the [Portainer](https://www.portainer.io/) container management tool.\nThis package is a wrapper around the Portainer API, which allows you to interact with Portainer programmatically.\n\nIn it's current stage it's still in development and not all endpoints are implemented yet.\n\n## Installation\n\n```bash\npip install pyportainer\n```\n\n### Example\n\n```python\nimport asyncio\n\nfrom pyportainer import Portainer\n\n\nasync def main() -> None:\n    \"\"\"Run the example.\"\"\"\n    async with Portainer(\n        api_url=\"http://localhost:9000\",\n        api_key=\"YOUR_API_KEY\",\n    ) as portainer:\n        endpoints = await portainer.get_endpoints()\n        print(\"Portainer Endpoints:\", endpoints)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\nMore examples can be found in the [examples folder](./examples/).\n\n## Contributing\n\nThis is an active open-source project. We are always open to people who want to\nuse the code or contribute to it.\n\nWe've set up a separate document for our\n[contribution guidelines](CONTRIBUTING.md).\n\nThank you for being involved! :heart_eyes:\n\n## Setting up development environment\n\nThe simplest way to begin is by utilizing the [Dev Container][devcontainer]\nfeature of Visual Studio Code or by opening a CodeSpace directly on GitHub.\nBy clicking the button below you immediately start a Dev Container in Visual Studio Code.\n\n[![Open in Dev Containers][devcontainer-shield]][devcontainer]\n\nThis Python project relies on [Poetry][poetry] as its dependency manager,\nproviding comprehensive management and control over project dependencies.\n\nYou need at least:\n\n- Python 3.11+\n- [Poetry][poetry-install]\n\n### Installation\n\nInstall all packages, including all development requirements:\n\n```bash\npoetry install\n```\n\n_Poetry creates by default an virtual environment where it installs all\nnecessary pip packages_.\n\n### Pre-commit\n\nThis repository uses the [pre-commit][pre-commit] framework, all changes\nare linted and tested with each commit. To setup the pre-commit check, run:\n\n```bash\npoetry run pre-commit install\n```\n\nAnd to run all checks and tests manually, use the following command:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\n### Testing\n\nIt uses [pytest](https://docs.pytest.org/en/stable/) as the test framework. To run the tests:\n\n```bash\npoetry run pytest\n```\n\nTo update the [syrupy](https://github.com/tophat/syrupy) snapshot tests:\n\n```bash\npoetry run pytest --snapshot-update\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Erwin Douna\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n<!-- LINKS FROM PLATFORM -->\n\n\n<!-- MARKDOWN LINKS & IMAGES -->\n[build-shield]: https://github.com/erwindouna/pyportainer/actions/workflows/tests.yaml/badge.svg\n[build-url]: https://github.com/erwindouna/pyportainer/actions/workflows/tests.yaml\n[codecov-shield]: https://codecov.io/gh/erwindouna/pyportainer/branch/main/graph/badge.svg?token=TOKEN\n[codecov-url]: https://codecov.io/gh/erwindouna/pyportainer\n[commits-shield]: https://img.shields.io/github/commit-activity/y/erwindouna/pyportainer.svg\n[commits-url]: https://github.com/erwindouna/pyportainer/commits/main\n[devcontainer-shield]: https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode\n[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/erwindouna/pyportainer\n[downloads-shield]: https://img.shields.io/pypi/dm/pyportainer\n[downloads-url]: https://pypistats.org/packages/pyportainer\n[last-commit-shield]: https://img.shields.io/github/last-commit/erwindouna/pyportainer.svg\n[license-shield]: https://img.shields.io/github/license/erwindouna/pyportainer.svg\n[maintainability-shield]: https://api.codeclimate.com/v1/badges/TOKEN/maintainability\n[maintainability-url]: https://codeclimate.com/github/erwindouna/pyportainer/maintainability\n[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg\n[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg\n[pypi]: https://pypi.org/project/pyportainer/\n[python-versions-shield]: https://img.shields.io/pypi/pyversions/pyportainer\n[releases-shield]: https://img.shields.io/github/release/erwindouna/pyportainer.svg\n[releases]: https://github.com/erwindouna/pyportainer/releases\n[typing-shield]: https://github.com/erwindouna/pyportainer/actions/workflows/typing.yaml/badge.svg\n[typing-url]: https://github.com/erwindouna/pyportainer/actions/workflows/typing.yaml\n\n[poetry-install]: https://python-poetry.org/docs/#installation\n[poetry]: https://python-poetry.org\n[pre-commit]: https://pre-commit.com\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Asynchronous Python client for the Portainer API",
    "version": "0.1.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/erwindouna/pyportainer/issues",
        "Changelog": "https://github.com/erwindouna/pyportainer/releases",
        "Documentation": "https://github.com/erwindouna/pyportainer",
        "Homepage": "https://github.com/erwindouna/pyportainer",
        "Repository": "https://github.com/erwindouna/pyportainer"
    },
    "split_keywords": [
        "python-portainer",
        " api",
        " async",
        " client"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4a440d7deb83a7e5ba113a4df857491a7c1e08a115e565bbe00ecc488226cc9c",
                "md5": "fe1ea1e888f90be635e9e8c5f3d6095d",
                "sha256": "00b08cb784bf33a790d204c17ade00579ae9884d84d1ce23f7d518b7823dd808"
            },
            "downloads": -1,
            "filename": "pyportainer-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe1ea1e888f90be635e9e8c5f3d6095d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 11707,
            "upload_time": "2025-08-26T18:52:06",
            "upload_time_iso_8601": "2025-08-26T18:52:06.212474Z",
            "url": "https://files.pythonhosted.org/packages/4a/44/0d7deb83a7e5ba113a4df857491a7c1e08a115e565bbe00ecc488226cc9c/pyportainer-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "30bffb76b363a3edb3253d9d06e2281955ddf189a3b41d7885073eaadc6e3086",
                "md5": "756ab98c38f69bb32fae0490dabcc2b5",
                "sha256": "789686a670d78948e47d21bd31404fea56116af15538905c02eb41a796f685a9"
            },
            "downloads": -1,
            "filename": "pyportainer-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "756ab98c38f69bb32fae0490dabcc2b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 12059,
            "upload_time": "2025-08-26T18:52:07",
            "upload_time_iso_8601": "2025-08-26T18:52:07.522765Z",
            "url": "https://files.pythonhosted.org/packages/30/bf/fb76b363a3edb3253d9d06e2281955ddf189a3b41d7885073eaadc6e3086/pyportainer-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-26 18:52:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "erwindouna",
    "github_project": "pyportainer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyportainer"
}
        
Elapsed time: 1.60447s