Skip to main content

CoregIO

PyPI version

The CoregIO Python Library empowers you to seamlessly fetch objects from the Container Registry API. This capability enables you to retrieve container images, manifests and other objects stored in a Container registry with ease. With a simple and intuitive interface, you can specify the object you want to fetch, such as an image by its name and tag, and the library takes care of the underlying API calls and data retrieval. Whether you need to pull a specific image or access various objects within the registry, this library streamlines the process, allowing you to interact with the Docker Registry API effortlessly.

Supported auth methods

In order to connect to a remote registry using standard docker registry API the library supports several authentication methods.

  • Bearer
  • OAuth2
  • Basic

How to install

The library is available on PyPi and can be downloaded using pip.

$ pip install coregio

Usage

The Coregio Python Library empowers you to seamlessly fetch objects from the Container Registry API. This capability enables you to retrieve container images, manifests and other objects stored in a Container registry with ease. With a simple and intuitive interface, you can specify the object you want to fetch, such as an image by its name and tag, and the library takes care of the underlying API calls and data retrieval. Whether you need to pull a specific image or access various objects within the registry, this library streamlines the process, allowing you to interact with the Docker Registry API effortlessly.

Repository tags

from coregio.registry_api import ContainerRegistry

# Create a registry interface and fetch repository tags
registry = ContainerRegistry("quay.io")
tags = registry.get_tags("prometheus/node-exporter")
print(tags)
['v0.17.0', 'v0.15.1', 'v0.15.2', 'latest', 'master']

Image manifest

manifest = registry.get_manifest(
    "prometheus/node-exporter",
    "latest",
)
print(manifest)
{'schemaVersion': 2, 'mediaType': 'application/vnd.docker.distribution.manifest.v2+json', 'config': {'mediaType': 'application/vnd.docker.container.image.v1+json', 'size': 3361, 'digest': 'sha256:173d3570a5af2b2ef8816b40af3ca985280549520e8d328a7f20333d9f354d1b'}, 'layers': [{'mediaType': 'application/vnd.docker.image.rootfs.diff.tar.gzip', 'size': 777654, 'digest': 'sha256:e6b9e25f5d0157c1c76c9d3680c4645368c9ac87cb008b5eddf9d856b8551373'}, {'mediaType': 'application/vnd.docker.image.rootfs.diff.tar.gzip', 'size': 486261, 'digest': 'sha256:0c6a06713be86bfb61b5f1ce1217f7b509c7ea7b894af65149cafac5004ee28f'}, {'mediaType': 'application/vnd.docker.image.rootfs.diff.tar.gzip', 'size': 10458504, 'digest': 'sha256:15ef7072c2ab4f35955068b02a09e669a5613d5bfca4f5c442c45b958036f17a'}]}


# User can select a manifest type based on accept headers
manifest = registry.get_manifest(
    "prometheus/node-exporter",
    "latest",
    manifest_types=["oci_index"]
)
print(manifest)
{'schemaVersion': 2, 'mediaType': 'application/vnd.docker.distribution.manifest.list.v2+json', 'manifests': [{'mediaType': 'application/vnd.docker.distribution.manifest.v2+json', 'size': 595, 'digest': 'sha256:1b2da31e89c8efe8d67f726f9872ca2fce95ddb1d5d97fd71468d5c48de85ddf', 'platform': {'architecture': 'amd64', 'os': 'linux'}}, {'mediaType': 'application/vnd.docker.distribution.manifest.v2+json', 'size': 595, 'digest': 'sha256:18ef5a4eb0a00e0513c8d4fb87bc31728e4c7ed6caea83c608c5048418b00185', 'platform': {'architecture': 'ppc64le', 'os': 'linux'}}, {'mediaType': 'application/vnd.docker.distribution.manifest.v2+json', 'size': 595, 'digest': 'sha256:c3e79af3edaf3b05282565c0b3e08e5b189e4200153114475256d00367da09da', 'platform': {'architecture': 's390x', 'os': 'linux'}}, {'mediaType': 'application/vnd.docker.distribution.manifest.v2+json', 'size': 595, 'digest': 'sha256:7da24517de68a4af11f098841d10c2e02f12619c662e5b812bff7959e2a477a6', 'platform': {'architecture': 'arm64', 'os': 'linux'}}]}
# Using a proxy
registry = ContainerRegistry(
    "quay.io",
    proxy="http://proxy.example.com"
)

manifest = registry.get_manifest(
    "redhat-isv-containers/5e61e93ffe2231a0c286037e",
    "latest",
)

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request. Please follow our CONTRIBUTING.md

Metadata

Release files for coregio 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coregio 0.7.1
File Size Uploaded
coregio-0.7.1.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coregio 0.7.1
File Interpreter ABI Platform
coregio-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.1 kB

Release files / coregio-0.7.1.tar.gz

Download URL coregio-0.7.1.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4e0a0fd4ae38c6764442100530009aa51da307b41fcc8c48d0e12f302065cfe6
BLAKE2b-256 checksum
How to use checksums
c7c0307f57e5b31485017acc1c533fbd811db0b014cf33f704b3a8d3e393b590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / coregio-0.7.1-py3-none-any.whl

Download URL coregio-0.7.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fc1df8d3bad4c5f9f480f13f4646ba7e8ad26e0d3d4d48ec85da6bfe4d3f609
BLAKE2b-256 checksum
How to use checksums
44e2aac2d0e6b96da03541f7b148696bc85be48409ebefe91892cf65592ef4ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page