docker-image-py
Parse docker image as distribution does.
What it is and what it does
docker-image-py is a Python library for parsing Docker image reference strings into structured components. It implements the Docker distribution reference grammar, allowing you to extract and normalize registry hostnames, repository names, tags, and content digests from image strings.
The package provides two main parsing modes: parse_normalized_named() applies Docker CLI conventions (filling in docker.io for unqualified names, adding library/ for official images), while parse() performs raw grammar-level parsing without inference. It's useful in tools that need to validate, normalize, or decompose image references programmatically.
Use it for:
- Normalize user-provided image names to ensure consistent registry and namespace handling.
- Extract registry hostname and repository path from image strings for routing to custom registries.
- Parse image digests and tags for validation or logging in deployment workflows.
- Validate Docker image reference syntax before passing to container runtime APIs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses Docker image reference strings into their component parts (registry, repository, tag, digest) following Docker's distribution reference grammar and normalization rules.
Yes. The package solves a specific, well-defined problem (Docker image reference parsing) with low install friction, active maintenance, permissive licensing, and no known vulnerabilities. It's appropriate for any tool that needs to handle Docker image strings programmatically.
Install
docker-image-py on PyPI
pip
pip install docker-image-pyuv
uv add docker-image-pypoetry
poetry add docker-image-pyInstalling docker-image-py
Before you install
Low friction install with a single runtime dependency (regex). Active maintenance with recent release 46 days ago and current Python version support (3.10–3.14).
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install docker-image-py
from docker_image import reference
ref = reference.Reference.parse_normalized_named('ubuntu')
print(ref.familiar_name())
Requires Python 3.10 or later.
Verify before relying
- Whether parse_normalized_named() and parse() handle all edge cases in real-world container registries beyond the examples shown.
- Performance characteristics when parsing large batches of image references.
- Compatibility with container orchestration platforms and CI/CD systems that may have specific reference format requirements.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — regex |
| Maintenance | actively maintained — 46 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,169,705/month — #2,715 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: docker_image_py-0.2.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
azure-containerregistryClient library for managing container images,…
permissive · top 5,000 on PyPI
pemParses and splits PEM files (Base64-encoded DER…
permissive · top 5,000 on PyPI
cdk-ecr-deploymentA CDK construct that copies Docker images…
permissive · top 15,000 on PyPI
python-on-whalesA Python Docker client that wraps the Docker…
permissive · top 5,000 on PyPI
dparseParses Python dependency files…
permissive · top 5,000 on PyPI
dparse2Parses Python dependency manifests…
permissive · top 15,000 on PyPI
pypiserverRuns a minimal PyPI-compatible package server…
permissive · top 5,000 on PyPI
checksumdirComputes a single hash digest of all file…
permissive · top 15,000 on PyPI
pyunormalizeProvides Unicode normalization (NFC, NFD, NFKC,…
permissive · top 5,000 on PyPI
dockerfileParses Dockerfile syntax into structured Python…
permissive · top 15,000 on PyPI