skillfed

coverage-badge

Generate coverage badges for Coverage.py.

coverage-badge v1.1.2 355.4K downloads/30d#7,290 on PyPI204
Permissive license MIT Active released

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-badge

uv

uv add coverage-badge

poetry

poetry add coverage-badge

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Testing

Tags

coverage badge generatorcoverage.py badge svgtest coverage visualizationcoverage report badgeci coverage badgecoverage percentage display
coverage-reportingci-cd-integrationbadge-generation

More Testing packages