docker-registry-client-async


Namedocker-registry-client-async JSON
Version 0.2.10 PyPI version JSON
download
home_pagehttps://github.com/crashvb/docker-registry-client-async
SummaryAn AIOHTTP based Python REST client for the Docker Registry.
upload_time2023-01-25 14:56:16
maintainer
docs_urlNone
authorRichard Davis
requires_python>=3.8
licenseApache License 2.0
keywords async client docker docker-registry docker-registry-client registry registry-client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # docker-registry-client-async

[![pypi version](https://img.shields.io/pypi/v/docker-registry-client-async.svg)](https://pypi.org/project/docker-registry-client-async)
[![build status](https://github.com/crashvb/docker-registry-client-async/actions/workflows/main.yml/badge.svg)](https://github.com/crashvb/docker-registry-client-async/actions)
[![coverage status](https://coveralls.io/repos/github/crashvb/docker-registry-client-async/badge.svg)](https://coveralls.io/github/crashvb/docker-registry-client-async)
[![python versions](https://img.shields.io/pypi/pyversions/docker-registry-client-async.svg?logo=python&logoColor=FBE072)](https://pypi.org/project/docker-registry-client-async)
[![linting](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)
[![code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![license](https://img.shields.io/github/license/crashvb/docker-registry-client-async.svg)](https://github.com/crashvb/docker-registry-client-async/blob/master/LICENSE.md)

## Overview

An AIOHTTP based Python REST client for the Docker Registry.

## Getting Started

```python
import asyncio
import json
from docker_registry_client_async import DockerRegistryClientAsync, FormattedSHA256, ImageName, Manifest

async def get_config(drca: DockerRegistryClientAsync, image_name: ImageName, manifest: Manifest) -> bytes:
    config_digest = FormattedSHA256.parse(manifest.get_json()["config"]["digest"])
    result = await drca.get_blob(image_name, config_digest)
    return json.loads(result["blob"].decode("utf-8"))

async def get_manifest(drca: DockerRegistryClientAsync, image_name: ImageName) -> Manifest:
    result = await drca.get_manifest(image_name)
    return result["manifest"]

async def main():
    image_name = ImageName.parse("busybox:1.30.1")
    async with DockerRegistryClientAsync() as drca:
        manifest = await get_manifest(drca, image_name)
        config = await get_config(drca, image_name, manifest)
        print(config)

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

```

## Installation
### From [pypi.org](https://pypi.org/project/docker-registry-client-async/)

```
$ pip install docker_registry_client_async
```

### From source code

```bash
$ git clone https://github.com/crashvb/docker-registry-client-async
$ cd docker-registry-client-async
$ virtualenv env
$ source env/bin/activate
$ python -m pip install --editable .[dev]
```

### Environment Variables

| Variable | Default Value | Description |
| ---------| ------------- | ----------- |
| DRCA\_CACERTS | | The path to the certificate trust store.
| DRCA\_CHUNK\_SIZE | 2097152 | The chunk size to use then replicating content.
| DRCA\_CREDENTIALS\_STORE | ~/.docker/config.json | The credentials store from which to retrieve registry credentials.
| DRCA\_DEBUG | | Adds additional debug logging, mainly for troubleshooting and development.
| DRCA\_DEFAULT\_REGISTRY | index.docker.io | The default registry index to use when resolving image names.
| DRCA\_DEFAULT\_NAMESPACE | library | The default registry namespace to use when resolving image names.
| DRCA\_DEFAULT\_TAG | latest | The default image tag to use when resolving image names.
| DRCA\_PROTOCOL | https | The default transport protocol to when communicating with a registry.

## Development

[Source Control](https://github.com/crashvb/docker-registry-client-async)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/crashvb/docker-registry-client-async",
    "name": "docker-registry-client-async",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "async client docker docker-registry docker-registry-client registry registry-client",
    "author": "Richard Davis",
    "author_email": "crashvb@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/11/6c/89b43f3732b186b550673d70fd11499b46ed13af5da278358b5dbb09cce3/docker_registry_client_async-0.2.10.tar.gz",
    "platform": null,
    "description": "# docker-registry-client-async\n\n[![pypi version](https://img.shields.io/pypi/v/docker-registry-client-async.svg)](https://pypi.org/project/docker-registry-client-async)\n[![build status](https://github.com/crashvb/docker-registry-client-async/actions/workflows/main.yml/badge.svg)](https://github.com/crashvb/docker-registry-client-async/actions)\n[![coverage status](https://coveralls.io/repos/github/crashvb/docker-registry-client-async/badge.svg)](https://coveralls.io/github/crashvb/docker-registry-client-async)\n[![python versions](https://img.shields.io/pypi/pyversions/docker-registry-client-async.svg?logo=python&logoColor=FBE072)](https://pypi.org/project/docker-registry-client-async)\n[![linting](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint)\n[![code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![license](https://img.shields.io/github/license/crashvb/docker-registry-client-async.svg)](https://github.com/crashvb/docker-registry-client-async/blob/master/LICENSE.md)\n\n## Overview\n\nAn AIOHTTP based Python REST client for the Docker Registry.\n\n## Getting Started\n\n```python\nimport asyncio\nimport json\nfrom docker_registry_client_async import DockerRegistryClientAsync, FormattedSHA256, ImageName, Manifest\n\nasync def get_config(drca: DockerRegistryClientAsync, image_name: ImageName, manifest: Manifest) -> bytes:\n    config_digest = FormattedSHA256.parse(manifest.get_json()[\"config\"][\"digest\"])\n    result = await drca.get_blob(image_name, config_digest)\n    return json.loads(result[\"blob\"].decode(\"utf-8\"))\n\nasync def get_manifest(drca: DockerRegistryClientAsync, image_name: ImageName) -> Manifest:\n    result = await drca.get_manifest(image_name)\n    return result[\"manifest\"]\n\nasync def main():\n    image_name = ImageName.parse(\"busybox:1.30.1\")\n    async with DockerRegistryClientAsync() as drca:\n        manifest = await get_manifest(drca, image_name)\n        config = await get_config(drca, image_name, manifest)\n        print(config)\n\nif __name__ == \"__main__\":\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n## Installation\n### From [pypi.org](https://pypi.org/project/docker-registry-client-async/)\n\n```\n$ pip install docker_registry_client_async\n```\n\n### From source code\n\n```bash\n$ git clone https://github.com/crashvb/docker-registry-client-async\n$ cd docker-registry-client-async\n$ virtualenv env\n$ source env/bin/activate\n$ python -m pip install --editable .[dev]\n```\n\n### Environment Variables\n\n| Variable | Default Value | Description |\n| ---------| ------------- | ----------- |\n| DRCA\\_CACERTS | | The path to the certificate trust store.\n| DRCA\\_CHUNK\\_SIZE | 2097152 | The chunk size to use then replicating content.\n| DRCA\\_CREDENTIALS\\_STORE | ~/.docker/config.json | The credentials store from which to retrieve registry credentials.\n| DRCA\\_DEBUG | | Adds additional debug logging, mainly for troubleshooting and development.\n| DRCA\\_DEFAULT\\_REGISTRY | index.docker.io | The default registry index to use when resolving image names.\n| DRCA\\_DEFAULT\\_NAMESPACE | library | The default registry namespace to use when resolving image names.\n| DRCA\\_DEFAULT\\_TAG | latest | The default image tag to use when resolving image names.\n| DRCA\\_PROTOCOL | https | The default transport protocol to when communicating with a registry.\n\n## Development\n\n[Source Control](https://github.com/crashvb/docker-registry-client-async)\n\n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "An AIOHTTP based Python REST client for the Docker Registry.",
    "version": "0.2.10",
    "split_keywords": [
        "async",
        "client",
        "docker",
        "docker-registry",
        "docker-registry-client",
        "registry",
        "registry-client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a5fce5d46507777fde779d809176d0b589d99c62e53621c52d2523c39712d7de",
                "md5": "1798a7eb641077ae2a5ed7eedec3c84e",
                "sha256": "3667f695e90cfc74bbae2d84a288b7c9c9da9a970dd9a111d242fd3b7a708848"
            },
            "downloads": -1,
            "filename": "docker_registry_client_async-0.2.10-py3-none-any.whl",
            "has_sig": true,
            "md5_digest": "1798a7eb641077ae2a5ed7eedec3c84e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 52269,
            "upload_time": "2023-01-25T14:56:14",
            "upload_time_iso_8601": "2023-01-25T14:56:14.458322Z",
            "url": "https://files.pythonhosted.org/packages/a5/fc/e5d46507777fde779d809176d0b589d99c62e53621c52d2523c39712d7de/docker_registry_client_async-0.2.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "116c89b43f3732b186b550673d70fd11499b46ed13af5da278358b5dbb09cce3",
                "md5": "000834bbef922a0f9be4f154e9a17b2f",
                "sha256": "54a2ec7c2551cf2a3c72bde776d65f5a2df94d2cbaa6d2e3e858304de8401307"
            },
            "downloads": -1,
            "filename": "docker_registry_client_async-0.2.10.tar.gz",
            "has_sig": true,
            "md5_digest": "000834bbef922a0f9be4f154e9a17b2f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 41368,
            "upload_time": "2023-01-25T14:56:16",
            "upload_time_iso_8601": "2023-01-25T14:56:16.520005Z",
            "url": "https://files.pythonhosted.org/packages/11/6c/89b43f3732b186b550673d70fd11499b46ed13af5da278358b5dbb09cce3/docker_registry_client_async-0.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-25 14:56:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "crashvb",
    "github_project": "docker-registry-client-async",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "docker-registry-client-async"
}
        
Elapsed time: 0.03082s