Skip to main content

containerimage-py

containerimage-py

Test Sec Doc Build

A python library for interacting with container images and container image registries

Docs: https://containers.github.io/containerimage-py/

Contributing: CONTRIBUTING.md

Quick Example

Here is a quick motivating example for how you might use containerimage-py in your python scripts to fetch basic information about a container image.

from image.containerimage import ContainerImage

# Initialize a ContainerImage given a tag reference
my_image = ContainerImage("registry.k8s.io/pause:3.5")

# Display some basic information about the container image
print(
    f"Size of {str(my_image)}: " + \
    my_image.get_size_formatted(auth={}) # 499.91 MB
)
print(
    f"Digest for {str(my_image)}: " + \
    my_image.get_digest(auth={}) # sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07
)

# Inspect the container image image for a more consolidated summary
print(
    f"Inspect for {str(my_image)}:\n" + \
    str(my_image.inspect(auth={})) # Same as skopeo inspect docker://registry.k8s.io/pause:3.5
)

To run this example, simply execute the following from the root of this repository

python3 examples/quick-example.py

Installation

Using Pip

Run the following command to install the latest version of this package

pip install containerimage-py

Local Install

  1. Clone this repository
  2. Build the project from source
  3. Locate the .whl (wheel) file in the dist folder
    • It should be named something like so: containerimage_py-1.1.4-py3-none-any.whl
  4. Run the following command from the root of the repository, replacing the name of the .whl file if necessary
    pip install dist/containerimage_py-1.1.4-py3-none-any.whl
    

Build

From the root of this repository, execute

make build

Under the hood, this will execute python3 -m build and produce a .whl (wheel) and .tgz (TAR-GZip archive) file in the dist subdirectory. For more on this project's make recipes, see CONTRIBUTING.md.

Metadata

Release files for containerimage-py 1.1.4

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

Source distribution (sdist)

Source distribution for containerimage-py 1.1.4
File Size Uploaded Provenance
containerimage_py-1.1.4.tar.gz 45.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for containerimage-py 1.1.4
File Interpreter ABI Platform
containerimage_py-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 102.1 kB

Release files / containerimage_py-1.1.4.tar.gz

Download URL containerimage_py-1.1.4.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9df0f2b0408328cd595ee15041a0117525e85737060c4fa61aa6c4ae67c32aa2
BLAKE2b-256 checksum
How to use checksums
5a6f0a88c1cc3745477d648c22146151d3e0dbd69deba7ed2e8ce301411981e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / containerimage_py-1.1.4-py3-none-any.whl

Download URL containerimage_py-1.1.4-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1379c24fa60fedfafff50ef96a17880f90c4e2d25a02c4911389ddf955e1fa9
BLAKE2b-256 checksum
How to use checksums
9471f0e6daae50feaadd7bc37a6335f2b776f8f2c6db681e9206da8a8cc81531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Security for containerimage-py 1.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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