Metadata-Version: 2.4
Name: ghcr-badge
Version: 1.0.1
Summary: Generate ghcr.io container's status badge
Project-URL: Repository, https://github.com/eggplants/ghcr-badge
Author-email: eggplants <w10776e8w@yahoo.co.jp>
License: MIT
License-File: LICENSE.txt
Keywords: badge,ghcr,github-container-registry
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Typing :: Typed
Requires-Python: <4,>=3.10
Requires-Dist: anybadge<2,>=1.16
Requires-Dist: flask<4,>=3.1
Requires-Dist: gunicorn<24,>=23
Requires-Dist: humanfriendly<11,>=10
Requires-Dist: requests<3,>=2.32.3
Requires-Dist: types-humanfriendly<11,>=10.0.1.20241221
Requires-Dist: types-requests<3,>=2.32.0.20241016
Requires-Dist: types-waitress>=3.0.1.20250801
Requires-Dist: typing-extensions<5,>=4.12.2
Requires-Dist: waitress<4,>=3.0.2
Description-Content-Type: text/markdown

# ghcr-badge: Generate ghcr.io container's status badge

[![1] ![2] ![3]](https://github.com/eggplants/ghcr-badge/pkgs/container/ghcr-badge)

[![PyPI version](
  <https://badge.fury.io/py/ghcr-badge.svg>
  )](
  <https://badge.fury.io/py/ghcr-badge>
) [![CI](
  <https://github.com/eggplants/ghcr-badge/actions/workflows/ci.yml/badge.svg>
  )](
  <https://github.com/eggplants/ghcr-badge/actions/workflows/ci.yml>
)

## Motivation

<https://github.com/badges/shields/issues/5594>

## Deployment

[![Deploy to Render]](https://render.com/deploy?repo=https://github.com/eggplants/ghcr-badge)

- <https://ghcr-badge.egpl.dev/>
  - [![Website](https://img.shields.io/website?label=egpl.dev&url=https%3A%2F%2Fghcr-badge.egpl.dev)](https://ghcr-badge.egpl.dev)

- ~<https://ghcr-badge.deta.dev/>~
  - Deta Space was [closed](https://deta.space/sunset)

[Deploy to Render]: <https://render.com/images/deploy-to-render-button.svg>

## Available paths

- `/<package_owner>/<package_name>/tags?color=...&ignore=...&n=...&label=...&trim=...`
  - defaults: `color=#44cc11`, `ignore=latest`, `n=3`, `label=image tags`
  - <https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/tags?trim=major>
  - 👉: ![1]
- `/<package_owner>/<package_name>/latest_tag?color=...&ignore=...&label=...&trim=...`
  - defaults: `color=#44cc11`, `ignore=latest`, `label=version`
  - <https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/latest_tag?trim=major&label=latest>
  - 👉: ![2]
- `/<package_owner>/<package_name>/size?color=...&tag=...&label=...&trim=...`
  - defaults: `color=#44cc11`, `tag=latest`, `label=image size`
  - <https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/size>
  - 👉: ![3]

## Common parameters

### `label` parameter

- `label=hello`: ![label=hello](https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/tags?trim=major&label=hello)

### `ignore` parameter

Use the ignore parameter to filter returned tags, supports pattern matching and a comma separated list.

- `ignore=latest` ignores the `latest` tag (default).
- `ignore=sha256*` ignores all tags prefixed with `sha256`.
- `ignore=v0.0.1,latest,sha256*` ignores the `latest` and `v0.0.1` tags, and all tags prefixed with `sha256*`.

### `trim` parameter

- `trim=patch` trims `^v?\d+\.\d+\.\d+[^.]*$` tags.
- `trim=major` trims `^v?\d+\.\d+[^.]*$` tags.

### `color` parameter

Available color names and hex codes are listed on: <https://github.com/jongracecox/anybadge#colors>

## Note

Generated badge will be cached for 3666 seconds in GitHub's [Camo](https://github.com/atmos/camo) server.
To update immediately, send PURGE request to the badge Camo link.

```bash
curl -X PURGE "https://camo.githubusercontent.com/..."
```

[1]: <https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/tags?trim=major>
[2]: <https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/latest_tag?trim=major&label=latest>
[3]: <https://ghcr-badge.egpl.dev/eggplants/ghcr-badge/size>
