Skip to main content

Generate coverage badges for Coverage.py.

Project description

Build status PyPI Downloads

A small script to generate coverage badges using Coverage.py. Example of a generated badge:

Example coverage badge

The badge template has been taken from shields.io, therefore it should look mostly good. (The spec is a bit stricter on the margins, but I can’t easily do text width calculations in Python so the margins might not always be 4px.)

Usage

First, run Coverage.py to generate the necessary coverage data. Then you can either return the badge SVG to stdout:

$ coverage-badge

…or write it to a file:

$ coverage-badge -o coverage.svg

It’s important that you run coverage-badge from the directory where the .coverage data file is located.

Different colors for cover ranges:

15% 45% 65% 80% 93% 97%

The full usage text:

usage: __main__.py [-h] [-o FILEPATH] [-p] [-f] [-q] [-v]

Generate coverage badges for Coverage.py.

optional arguments:
  -h, --help   show this help message and exit
  -o FILEPATH  Save the file to the specified path.
  -p           Plain color mode. Standard green badge.
  -f           Force overwrite image, use with -o key.
  -q           Don't output any non-error messages.
  -v           Show version.

License

MIT License, see LICENSE.txt file..

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coverage-badge-0.2.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

coverage_badge-0.2.0-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file coverage-badge-0.2.0.tar.gz.

File metadata

File hashes

Hashes for coverage-badge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2438cda2143c2a1ecbdc098115209659991ab240384690b37aece6255c0e3668
MD5 bff2b0111f39c37d3171b1734b67f3fa
BLAKE2b-256 9b3a99a6dee266bde1943ce04f4601d49a825fa116a7884cf7316ddbb847c000

See more details on using hashes here.

File details

Details for the file coverage_badge-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for coverage_badge-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6a7e83601e6e233264b810f4aebe4f555f65bebc6a823e2a612e1504aac3f83f
MD5 af4fc2d5c13694693e1f7c6facc42135
BLAKE2b-256 823879d3ab3ec2665aa5950a226edafddc5301debd227f101b404015504fc26e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page