docker-sdk


Namedocker-sdk JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/FreeTwilight/docker.git
SummaryThe docker python client supports asynchronous parallel access to containers.
upload_time2024-08-15 09:33:54
maintainerNone
docs_urlNone
authorFreeTwilight
requires_python>=3.6
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Docker SDK for Python
The docker python client supports asynchronous parallel access to containers.

Develop with Docker Engine SDKs
Docker provides an API for interacting with the Docker daemon (called the Docker Engine API), as well as SDKs for Go and Python. The SDKs allow you to efficiently build and scale Docker apps and solutions. If Go or Python don't work for you, you can use the Docker Engine API directly.

# Reference Docs
This site was built using [Dokcer Docs manuals](https://docs.docker.com/manuals/).

# Installation
The latest stable version is available on PyPI. Install with pip:
```
pip install docker-sdk
```

# Usage 
### 1. Example docker run
```
import asyncio,time
import sys,os,json

from docker.containers import Containers

async def main():
    containers = Containers("172.16.80.42","2376")
    await containers.init_session()
    try:

        ret = await containers.run(params={ "name": "hello9"},body = {'Image': 'searxng/searxng:latest'})
        print(json.dumps(ret,ensure_ascii = False,indent=4))
        
    finally:
        await containers.close()

    
asyncio.run(main())
```
### 2. Example docker list
```
import asyncio,time
import sys,os,json

from  docker.containers  import Containers

async def main():
    containers = Containers("172.16.80.42","2376")
    await containers.init_session()
    try:
        ret = await containers.list(params = {"all":"true"})
        print(json.dumps(ret,ensure_ascii = False,indent=4))
        
    finally:
        await containers.close()

    
asyncio.run(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FreeTwilight/docker.git",
    "name": "docker-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "FreeTwilight",
    "author_email": "zunpengyang@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e3/69/0de99f5c4a80a4ada9e89dad0da72aff617eb8250ed08564a2fbeb316b1f/docker-sdk-1.0.3.tar.gz",
    "platform": null,
    "description": "# Docker SDK for Python\nThe docker python client supports asynchronous parallel access to containers.\n\nDevelop with Docker Engine SDKs\nDocker provides an API for interacting with the Docker daemon (called the Docker Engine API), as well as SDKs for Go and Python. The SDKs allow you to efficiently build and scale Docker apps and solutions. If Go or Python don't work for you, you can use the Docker Engine API directly.\n\n# Reference Docs\nThis site was built using [Dokcer Docs manuals](https://docs.docker.com/manuals/).\n\n# Installation\nThe latest stable version is available on PyPI. Install with pip:\n```\npip install docker-sdk\n```\n\n# Usage \n### 1. Example docker run\n```\nimport asyncio,time\nimport sys,os,json\n\nfrom docker.containers import Containers\n\nasync def main():\n    containers = Containers(\"172.16.80.42\",\"2376\")\n    await containers.init_session()\n    try:\n\n        ret = await containers.run(params={ \"name\": \"hello9\"},body = {'Image': 'searxng/searxng:latest'})\n        print(json.dumps(ret,ensure_ascii = False,indent=4))\n        \n    finally:\n        await containers.close()\n\n    \nasyncio.run(main())\n```\n### 2. Example docker list\n```\nimport asyncio,time\nimport sys,os,json\n\nfrom  docker.containers  import Containers\n\nasync def main():\n    containers = Containers(\"172.16.80.42\",\"2376\")\n    await containers.init_session()\n    try:\n        ret = await containers.list(params = {\"all\":\"true\"})\n        print(json.dumps(ret,ensure_ascii = False,indent=4))\n        \n    finally:\n        await containers.close()\n\n    \nasyncio.run(main())\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "The docker python client supports asynchronous parallel access to containers.",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/FreeTwilight/docker.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98be1629b96c4df6c2787656bc7aa0dd0d9de861c0f88f9b1fc18e1330fc8e6d",
                "md5": "73b1917d65c75afb98fe7442a5db5474",
                "sha256": "8706a18d91b8ac88c690d436b36f6f7f3834a90b9c8089495a50f4bda55252da"
            },
            "downloads": -1,
            "filename": "docker_sdk-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "73b1917d65c75afb98fe7442a5db5474",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 32560,
            "upload_time": "2024-08-15T09:33:52",
            "upload_time_iso_8601": "2024-08-15T09:33:52.984813Z",
            "url": "https://files.pythonhosted.org/packages/98/be/1629b96c4df6c2787656bc7aa0dd0d9de861c0f88f9b1fc18e1330fc8e6d/docker_sdk-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3690de99f5c4a80a4ada9e89dad0da72aff617eb8250ed08564a2fbeb316b1f",
                "md5": "def4b799f8b6db7b2c3fa7e413f6432c",
                "sha256": "d7609644e16704f99529f791e9a518a3bf413767404983eaaa3d2311960299e4"
            },
            "downloads": -1,
            "filename": "docker-sdk-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "def4b799f8b6db7b2c3fa7e413f6432c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 27482,
            "upload_time": "2024-08-15T09:33:54",
            "upload_time_iso_8601": "2024-08-15T09:33:54.849906Z",
            "url": "https://files.pythonhosted.org/packages/e3/69/0de99f5c4a80a4ada9e89dad0da72aff617eb8250ed08564a2fbeb316b1f/docker-sdk-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-15 09:33:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FreeTwilight",
    "github_project": "docker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "docker-sdk"
}
        
Elapsed time: 0.34722s