aiodocker


Nameaiodocker JSON
Version 0.21.0 PyPI version JSON
download
home_pagehttps://github.com/aio-libs/aiodocker
SummaryDocker API client for asyncio
upload_time2021-07-23 09:51:27
maintainer
docs_urlNone
authorPaul Tagliamonte
requires_python>=3.6
licenseApache 2
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==============================
AsyncIO bindings for docker.io
==============================

.. image:: https://badge.fury.io/py/aiodocker.svg
   :target: https://badge.fury.io/py/aiodocker
   :alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/aiodocker.svg
   :target: https://pypi.org/project/aiodocker/
   :alt: Python Versions

.. image:: https://travis-ci.com/aio-libs/aiodocker.svg?branch=master
   :target: https://travis-ci.com/aio-libs/aiodocker
   :alt: Build Status

.. image:: https://codecov.io/gh/aio-libs/aiodocker/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/aio-libs/aiodocker
   :alt: Code Coverage

.. image:: https://badges.gitter.im/Join%20Chat.svg
    :target: https://gitter.im/aio-libs/Lobby
    :alt: Chat on Gitter

A simple Docker HTTP API wrapper written with asyncio and aiohttp.


Installation
============

.. code-block:: sh

   pip install aiodocker

Documentation
=============

http://aiodocker.readthedocs.io


Examples
========

.. code-block:: python

   import asyncio
   import aiodocker

   async def list_things():
       docker = aiodocker.Docker()
       print('== Images ==')
       for image in (await docker.images.list()):
           tags = image['RepoTags'][0] if image['RepoTags'] else ''
           print(image['Id'], tags)
       print('== Containers ==')
       for container in (await docker.containers.list()):
           print(f" {container._id}")
       await docker.close()

   async def run_container():
       docker = aiodocker.Docker()
       print('== Running a hello-world container ==')
       container = await docker.containers.create_or_replace(
           config={
               'Cmd': ['/bin/ash', '-c', 'echo "hello world"'],
               'Image': 'alpine:latest',
           },
           name='testing',
       )
       await container.start()
       logs = await container.log(stdout=True)
       print(''.join(logs))
       await container.delete(force=True)
       await docker.close()

   if __name__ == '__main__':
       loop = asyncio.get_event_loop()
       loop.run_until_complete(list_things())
       loop.run_until_complete(run_container())
       loop.close()

=======
Changes
=======

..
    You should *NOT* be adding new change log entries to this file, this
    file is managed by towncrier. You *may* edit previous change logs to
    fix problems like typo corrections or such.
    To add a new change log entry, please see
    https://pip.pypa.io/en/latest/development/#adding-a-news-entry
    we named the news folder "changes".

.. towncrier release notes start

0.21.0 (2021-07-23)
===================

Bugfixes
--------

- Use ssl_context passsed to Docker constructor for creating underlying connection to docker engine. (#536)
- Fix an error when attach/exec when container stops before close connection to it. (#608)


0.20.0 (2021-07-21)
===================

Bugfixes
--------

- Accept auth parameter by `run()` method; it allows auto-pulling absent image from private storages. (#295)
- Fix passing of JSON params. (#543)
- Fix issue with unclosed response object in attach/exec. (#604)


0.19.1 (2020-07-09)
===================

Bugfixes
--------

- Fix type annotations for `exec.start()`, `docker.images.pull()`,
  `docker.images.push()`. Respect default arguments again.

0.19.0 (2020-07-07)
===================

Features
--------

- Run mypy checks on the repo in the non-strict mode. (#466)
- Add ``container.rename()`` method. (#458)


Bugfixes
--------

- Changed DockerNetwork.delete() to return True if successful (#464)


0.18.9 (2020-07-07)
===================

Bugfixes
--------

- Fix closing of the task fetching Docker's event stream and make it re-openable after closing (#448)
- Fix type annotations for pull() and push() methods. (#465)


Misc
----

- #442


0.18.8 (2020-05-04)
===================

Bugfixes
--------

- Don't send ``null`` for empty BODY.


0.18.7 (2020-05-04)
===================

Bugfixes
--------

- Fix some typing errors


0.18.1 (2020-04-01)
===================

Bugfixes
--------

- Improve the errror message when connection is closed by Docker Engine on TCP hijacking. (#424)


0.18.0 (2020-03-25)
===================

Features
--------

- Improve the error text message if cannot connect to docker engine. (#411)
- Rename `websocket()` to `attach()` (#412)
- Implement docker exec protocol. (#415)
- Implement container commit, pause and unpause functionality. (#418)
- Implement auto-versioning of the docker API by default. (#419)


Bugfixes
--------

- Fix volume.delete throwing a TypeError. (#389)


0.17.0 (2019-10-15)
===================

Bugfixes
--------

- Fixed an issue when the entire tar archive was stored in RAM while building the image. (#352)


0.16.0 (2019-09-23)
===================

Bugfixes
--------

- Fix streaming mode for pull, push, build, stats and events. (#344)


0.15.0 (2019-09-22)
===================

Features
--------

- Add support for Docker 17.12.1 and 18.03.1 (#164)
- Add initial support for nodes. (#181)
- Add initial support for networks. (#189)
- Add support for docker info ando docker swarm join. (#193)
- Add restart method for containers. (#200)
- Feature: Add support for registry-auth when you create a service. (#215)
- Feature: Add support for docker save and load api methods (#219)
- Pass params to docker events. (#223)
- Add ability to get a Docker network by name or ID. (#279)
- Always close response after processing, make `.logs(..., follow=True)` async iterator. (#341)


Bugfixes
--------

- Fix: Set timeout for docker events to 0 (no timeout) (#115)
- Fix: prevents multiple listener tasks to be created automatically (#116)
- Fix: if container.start() fails user won't get the id of the container (#128)
- Improve logging when docker socket not available. (#155)
- Fix current project version. (#156)
- Fix `update out of sequence.` (#169)
- Remove asserts used to check auth with docker registry. (#172)
- Fix: fix to parse response of docker load method as a json stream (#222)
- Fix: Handle responses with 0 or missing Content-Length (#237)
- Fix: don't remove non-newline whitespace from multiplexed lines (#246)
- Fix docker_context.tar error (#253)


Deprecations and Removals
-------------------------

- docker.images.get has been renamed to docker.images.inspect, remove support for Docker 17.06 (#164)
- Drop Python 3.5 (#338)
- Drop deprecated container.copy() (#339)


Misc
----

- #28, #167, #192, #286



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aio-libs/aiodocker",
    "name": "aiodocker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Paul Tagliamonte",
    "author_email": "paultag@debian.org",
    "download_url": "https://files.pythonhosted.org/packages/6f/f5/5fb3a17fcdd31d3cce9afa82c306da869e2b36c5ca1477224396e5e1f31b/aiodocker-0.21.0.tar.gz",
    "platform": "any",
    "description": "==============================\nAsyncIO bindings for docker.io\n==============================\n\n.. image:: https://badge.fury.io/py/aiodocker.svg\n   :target: https://badge.fury.io/py/aiodocker\n   :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/aiodocker.svg\n   :target: https://pypi.org/project/aiodocker/\n   :alt: Python Versions\n\n.. image:: https://travis-ci.com/aio-libs/aiodocker.svg?branch=master\n   :target: https://travis-ci.com/aio-libs/aiodocker\n   :alt: Build Status\n\n.. image:: https://codecov.io/gh/aio-libs/aiodocker/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/aio-libs/aiodocker\n   :alt: Code Coverage\n\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n    :target: https://gitter.im/aio-libs/Lobby\n    :alt: Chat on Gitter\n\nA simple Docker HTTP API wrapper written with asyncio and aiohttp.\n\n\nInstallation\n============\n\n.. code-block:: sh\n\n   pip install aiodocker\n\nDocumentation\n=============\n\nhttp://aiodocker.readthedocs.io\n\n\nExamples\n========\n\n.. code-block:: python\n\n   import asyncio\n   import aiodocker\n\n   async def list_things():\n       docker = aiodocker.Docker()\n       print('== Images ==')\n       for image in (await docker.images.list()):\n           tags = image['RepoTags'][0] if image['RepoTags'] else ''\n           print(image['Id'], tags)\n       print('== Containers ==')\n       for container in (await docker.containers.list()):\n           print(f\" {container._id}\")\n       await docker.close()\n\n   async def run_container():\n       docker = aiodocker.Docker()\n       print('== Running a hello-world container ==')\n       container = await docker.containers.create_or_replace(\n           config={\n               'Cmd': ['/bin/ash', '-c', 'echo \"hello world\"'],\n               'Image': 'alpine:latest',\n           },\n           name='testing',\n       )\n       await container.start()\n       logs = await container.log(stdout=True)\n       print(''.join(logs))\n       await container.delete(force=True)\n       await docker.close()\n\n   if __name__ == '__main__':\n       loop = asyncio.get_event_loop()\n       loop.run_until_complete(list_things())\n       loop.run_until_complete(run_container())\n       loop.close()\n\n=======\nChanges\n=======\n\n..\n    You should *NOT* be adding new change log entries to this file, this\n    file is managed by towncrier. You *may* edit previous change logs to\n    fix problems like typo corrections or such.\n    To add a new change log entry, please see\n    https://pip.pypa.io/en/latest/development/#adding-a-news-entry\n    we named the news folder \"changes\".\n\n.. towncrier release notes start\n\n0.21.0 (2021-07-23)\n===================\n\nBugfixes\n--------\n\n- Use ssl_context passsed to Docker constructor for creating underlying connection to docker engine. (#536)\n- Fix an error when attach/exec when container stops before close connection to it. (#608)\n\n\n0.20.0 (2021-07-21)\n===================\n\nBugfixes\n--------\n\n- Accept auth parameter by `run()` method; it allows auto-pulling absent image from private storages. (#295)\n- Fix passing of JSON params. (#543)\n- Fix issue with unclosed response object in attach/exec. (#604)\n\n\n0.19.1 (2020-07-09)\n===================\n\nBugfixes\n--------\n\n- Fix type annotations for `exec.start()`, `docker.images.pull()`,\n  `docker.images.push()`. Respect default arguments again.\n\n0.19.0 (2020-07-07)\n===================\n\nFeatures\n--------\n\n- Run mypy checks on the repo in the non-strict mode. (#466)\n- Add ``container.rename()`` method. (#458)\n\n\nBugfixes\n--------\n\n- Changed DockerNetwork.delete() to return True if successful (#464)\n\n\n0.18.9 (2020-07-07)\n===================\n\nBugfixes\n--------\n\n- Fix closing of the task fetching Docker's event stream and make it re-openable after closing (#448)\n- Fix type annotations for pull() and push() methods. (#465)\n\n\nMisc\n----\n\n- #442\n\n\n0.18.8 (2020-05-04)\n===================\n\nBugfixes\n--------\n\n- Don't send ``null`` for empty BODY.\n\n\n0.18.7 (2020-05-04)\n===================\n\nBugfixes\n--------\n\n- Fix some typing errors\n\n\n0.18.1 (2020-04-01)\n===================\n\nBugfixes\n--------\n\n- Improve the errror message when connection is closed by Docker Engine on TCP hijacking. (#424)\n\n\n0.18.0 (2020-03-25)\n===================\n\nFeatures\n--------\n\n- Improve the error text message if cannot connect to docker engine. (#411)\n- Rename `websocket()` to `attach()` (#412)\n- Implement docker exec protocol. (#415)\n- Implement container commit, pause and unpause functionality. (#418)\n- Implement auto-versioning of the docker API by default. (#419)\n\n\nBugfixes\n--------\n\n- Fix volume.delete throwing a TypeError. (#389)\n\n\n0.17.0 (2019-10-15)\n===================\n\nBugfixes\n--------\n\n- Fixed an issue when the entire tar archive was stored in RAM while building the image. (#352)\n\n\n0.16.0 (2019-09-23)\n===================\n\nBugfixes\n--------\n\n- Fix streaming mode for pull, push, build, stats and events. (#344)\n\n\n0.15.0 (2019-09-22)\n===================\n\nFeatures\n--------\n\n- Add support for Docker 17.12.1 and 18.03.1 (#164)\n- Add initial support for nodes. (#181)\n- Add initial support for networks. (#189)\n- Add support for docker info ando docker swarm join. (#193)\n- Add restart method for containers. (#200)\n- Feature: Add support for registry-auth when you create a service. (#215)\n- Feature: Add support for docker save and load api methods (#219)\n- Pass params to docker events. (#223)\n- Add ability to get a Docker network by name or ID. (#279)\n- Always close response after processing, make `.logs(..., follow=True)` async iterator. (#341)\n\n\nBugfixes\n--------\n\n- Fix: Set timeout for docker events to 0 (no timeout) (#115)\n- Fix: prevents multiple listener tasks to be created automatically (#116)\n- Fix: if container.start() fails user won't get the id of the container (#128)\n- Improve logging when docker socket not available. (#155)\n- Fix current project version. (#156)\n- Fix `update out of sequence.` (#169)\n- Remove asserts used to check auth with docker registry. (#172)\n- Fix: fix to parse response of docker load method as a json stream (#222)\n- Fix: Handle responses with 0 or missing Content-Length (#237)\n- Fix: don't remove non-newline whitespace from multiplexed lines (#246)\n- Fix docker_context.tar error (#253)\n\n\nDeprecations and Removals\n-------------------------\n\n- docker.images.get has been renamed to docker.images.inspect, remove support for Docker 17.06 (#164)\n- Drop Python 3.5 (#338)\n- Drop deprecated container.copy() (#339)\n\n\nMisc\n----\n\n- #28, #167, #192, #286\n\n\n",
    "bugtrack_url": null,
    "license": "Apache 2",
    "summary": "Docker API client for asyncio",
    "version": "0.21.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "d3107094d517e18fb5283485ca80b92b",
                "sha256": "6fe00135bb7dc40a407669d3157ecdfd856f3737d939df54f40a479d40cf7bdc"
            },
            "downloads": -1,
            "filename": "aiodocker-0.21.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3107094d517e18fb5283485ca80b92b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 34132,
            "upload_time": "2021-07-23T09:51:25",
            "upload_time_iso_8601": "2021-07-23T09:51:25.212337Z",
            "url": "https://files.pythonhosted.org/packages/7e/86/97638ef9d0e54a86d389ded8ccf27cc1ecabf7ce27ae873636a5c1e46d89/aiodocker-0.21.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "e6f1560f12210832095b45901ec03684",
                "sha256": "1f2e6db6377195962bb676d4822f6e3a0c525e1b5d60b8ebbab68230bff3d227"
            },
            "downloads": -1,
            "filename": "aiodocker-0.21.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e6f1560f12210832095b45901ec03684",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 483246,
            "upload_time": "2021-07-23T09:51:27",
            "upload_time_iso_8601": "2021-07-23T09:51:27.181700Z",
            "url": "https://files.pythonhosted.org/packages/6f/f5/5fb3a17fcdd31d3cce9afa82c306da869e2b36c5ca1477224396e5e1f31b/aiodocker-0.21.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-07-23 09:51:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "aio-libs",
    "github_project": "aiodocker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "aiodocker"
}
        
Elapsed time: 0.01565s