# 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": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"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/f3/29/6cf3b4a9d32f49a7ac7a96153188bedb95f83ec8410829c66ee1c94a0017/docker_registry_client_async-1.0.0.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": "1.0.0",
"project_urls": {
"Bug Reports": "https://github.com/crashvb/docker-registry-client-async/issues",
"Homepage": "https://github.com/crashvb/docker-registry-client-async",
"Source": "https://github.com/crashvb/docker-registry-client-async"
},
"split_keywords": [
"async",
"client",
"docker",
"docker-registry",
"docker-registry-client",
"registry",
"registry-client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ff024ea330b118a9b97dec9f463ea0682e88625e590586c1161fb9fc2b599751",
"md5": "61ead69c85a856aa69033c1daf57af44",
"sha256": "e487ce629e99125e1cf4cf42d2dbe6d9121b449f30738d29ad9aa5e0f777c885"
},
"downloads": -1,
"filename": "docker_registry_client_async-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "61ead69c85a856aa69033c1daf57af44",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 52795,
"upload_time": "2024-08-13T02:07:47",
"upload_time_iso_8601": "2024-08-13T02:07:47.932330Z",
"url": "https://files.pythonhosted.org/packages/ff/02/4ea330b118a9b97dec9f463ea0682e88625e590586c1161fb9fc2b599751/docker_registry_client_async-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f3296cf3b4a9d32f49a7ac7a96153188bedb95f83ec8410829c66ee1c94a0017",
"md5": "ac794b4d8a7a5422cca99e7177a69c7c",
"sha256": "ce37c030fbef49547c08b4d3644e9c61c17638a523774897ff4a1706abe90fa0"
},
"downloads": -1,
"filename": "docker_registry_client_async-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "ac794b4d8a7a5422cca99e7177a69c7c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 45516,
"upload_time": "2024-08-13T02:07:49",
"upload_time_iso_8601": "2024-08-13T02:07:49.385403Z",
"url": "https://files.pythonhosted.org/packages/f3/29/6cf3b4a9d32f49a7ac7a96153188bedb95f83ec8410829c66ee1c94a0017/docker_registry_client_async-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-13 02:07:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crashvb",
"github_project": "docker-registry-client-async",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "docker-registry-client-async"
}