{"id":15044006,"url":"https://github.com/realityone/docker-image-py","last_synced_at":"2025-09-21T20:32:24.058Z","repository":{"id":48444623,"uuid":"73385506","full_name":"realityone/docker-image-py","owner":"realityone","description":"Parse docker image as distribution does.","archived":false,"fork":false,"pushed_at":"2024-07-17T05:31:20.000Z","size":41,"stargazers_count":20,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T18:16:50.068Z","etag":null,"topics":["docker-image","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/realityone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-10T13:39:16.000Z","updated_at":"2024-08-14T08:11:30.000Z","dependencies_parsed_at":"2024-09-21T14:02:46.698Z","dependency_job_id":"dfaf2659-a6f4-4aa5-8ac0-80c28a597d70","html_url":"https://github.com/realityone/docker-image-py","commit_stats":{"total_commits":19,"total_committers":4,"mean_commits":4.75,"dds":0.1578947368421053,"last_synced_commit":"7a9bd8cbaefb1a4defe0153a8770e0ee91338d37"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realityone%2Fdocker-image-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realityone%2Fdocker-image-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realityone%2Fdocker-image-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realityone%2Fdocker-image-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realityone","download_url":"https://codeload.github.com/realityone/docker-image-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233794925,"owners_count":18731360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","python"],"created_at":"2024-09-24T20:49:56.757Z","updated_at":"2025-09-21T20:32:18.790Z","avatar_url":"https://github.com/realityone.png","language":"Python","readme":"# docker-image-py\nParse docker image as distribution does.\n\n## Usage\n\n### Install\n\nYou can install from PyPI.\n\n```shell\n$ pip install docker-image-py\n```\n\nOr install from GitHub for latest version.\n\n```shell\n$ pip install https://github.com/realityone/docker-image-py/archive/master.zip\n```\n\n### Parse Docker Image\n\n```python\n\u003e\u003e\u003e from docker_image import reference\n\u003e\u003e\u003e \n\u003e\u003e\u003e # with registry, repo, tag, and digest\n\u003e\u003e\u003e ref = reference.Reference.parse(\n...     'daocloud.io/nginx:1.11-alpine@sha256:14bf491df1d58404433b577e093c906460871ee677d18caa276d9c03727e0b33'\n... )\n\u003e\u003e\u003e print ref\n{'tag': '1.11-alpine', 'name': 'daocloud.io/nginx', 'digest': 'sha256:14bf491df1d58404433b577e093c906460871ee677d18caa276d9c03727e0b33'}\n\u003e\u003e\u003e \n\u003e\u003e\u003e # with registry and repo\n\u003e\u003e\u003e ref = reference.Reference.parse(\n...     'daocloud.io/nginx'\n... )\n\u003e\u003e\u003e print ref\n{'tag': None, 'name': 'daocloud.io/nginx', 'digest': None}\n\u003e\u003e\u003e # get registry hostname\n\u003e\u003e\u003e hostname, name = ref.split_hostname()\n\u003e\u003e\u003e print 'hostname: {}, name: {}'.format(hostname, name)\nhostname: daocloud.io, name: nginx\n\u003e\u003e\u003e # with registry, repo and tag\n\u003e\u003e\u003e ref = reference.Reference.parse(\n...     'daocloud.io/nginx:latest'\n... )\n\u003e\u003e\u003e print ref\n{'tag': 'latest', 'name': 'daocloud.io/nginx', 'digest': None}\n\u003e\u003e\u003e # with repo and tag\n\u003e\u003e\u003e ref = reference.Reference.parse(\n...     'nginx:latest'\n... )\n\u003e\u003e\u003e print ref\n{'tag': 'latest', 'name': 'nginx', 'digest': None}\n\u003e\u003e\u003e # only repo\n\u003e\u003e\u003e ref = reference.Reference.parse(\n...     'nginx'\n... )\n\u003e\u003e\u003e print ref\n{'tag': None, 'name': 'nginx', 'digest': None}\n\u003e\u003e\u003e ref = reference.Reference.parse_normalized_named(\n...     'containous/traefik'\n... )\n\u003e\u003e\u003e print ref\n{'name': 'docker.io/containous/traefik', 'tag': None, 'digest': None}\n\u003e\u003e\u003e hostname, name = ref.split_hostname()\n\u003e\u003e\u003e print 'hostname: {}, name: {}'.format(hostname, name)\nhostname: docker.io, name: containous/traefik\n```\n\n## Reference\n\n- https://github.com/docker/distribution/tree/master/reference","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealityone%2Fdocker-image-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealityone%2Fdocker-image-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealityone%2Fdocker-image-py/lists"}