coverage-badge
Generate coverage badges for Coverage.py.
What it is and what it does
coverage-badge is a command-line tool that converts Coverage.py coverage data into an SVG badge graphic. It reads the .coverage file that Coverage.py generates and outputs a visual badge showing the coverage percentage, styled after shields.io templates. The tool is straightforward: run Coverage.py to collect metrics, then run coverage-badge to generate the badge SVG, either printing it to stdout or saving it to a file.
The package is in maintenance mode, meaning it receives occasional fixes but no new features. It depends on coverage and setuptools. For projects seeking richer badge support (test counts, flake8 reports, etc.), the maintainer recommends genbadge as an alternative. The badge itself uses color ranges to indicate coverage levels, with a plain-color mode available via command-line flag.
Use it for:
- Display a live coverage percentage badge in a GitHub README to show project test coverage at a glance.
- Automate badge generation in CI/CD pipelines after running test suites with Coverage.py.
- Generate coverage badges for documentation sites or project dashboards that track code quality metrics.
- Create visual indicators of coverage trends across multiple project branches or releases.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates SVG coverage badges from Coverage.py data files, displaying test coverage percentages in a visual format suitable for README files and CI/CD pipelines.
Yes, if you use Coverage.py and want a simple, low-friction way to generate coverage badges for README files or CI/CD workflows. The tool is stable, actively maintained, and has no known vulnerabilities. Install it only if you need basic coverage badge generation; if you need richer badge types (test counts, linting reports), consider genbadge instead.
Install
coverage-badge on PyPI
pip
pip install coverage-badgeuv
uv add coverage-badgepoetry
poetry add coverage-badgeInstalling coverage-badge
Before you install
Low friction install with just two runtime dependencies (coverage and setuptools). Actively maintained with recent commits, though in maintenance mode with no new features planned.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install coverage-badge
Run coverage first, then generate the badge:
coverage run -m pytest
coverage-badge -o coverage.svg
Requires a .coverage data file in the working directory, generated by running Coverage.py first.
Verify before relying
- Whether the package works with all modern Python versions despite unspecified python_support.
- Current state of maintenance mode and likelihood of bug fixes vs. feature requests.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — coverage, setuptools |
| Maintenance | actively maintained — 742 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 355,388/month — #7,290 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coverage_badge-1.1.2-py2.py3-none-any.whl
Keywords: coverage, badge, shield
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
anybadgeGenerates SVG badge images with configurable…
permissive · top 5,000 on PyPI
genbadgeGenerates SVG badges for CI/CD tools and test…
permissive · top 15,000 on PyPI
docstr-coverageMeasures docstring coverage in Python source…
permissive · top 15,000 on PyPI
covdefaultsA coverage plugin that automatically applies…
permissive · top 15,000 on PyPI
coverallsUploads Python test coverage reports to…
permissive · top 5,000 on PyPI
django-coverage-pluginA coverage.py plugin that measures test…
permissive · top 5,000 on PyPI
coverage_enable_subprocessInstalls a .pth file that automatically enables…
permissive · top 15,000 on PyPI
coverage-conditional-pluginA coverage.py plugin that applies conditional…
permissive · top 15,000 on PyPI
resvg_pyConverts SVG documents to raster image bytes…
unclear · top 5,000 on PyPI