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-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

coverage_badge-1.0.0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: coverage-badge-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for coverage-badge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b9a8a77d021192dc137f2a54784ee1bfa538ca10c344793cbb0d020912ba99f2
MD5 a3ddcfa4d6924bb1fe7dfc3553b15bae
BLAKE2b-256 243bf7db553abcb1745038722fb94406850446ee40a4af67395837d438d84b13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: coverage_badge-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for coverage_badge-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 508df30554a18dfa2cf1a4774bbf7eb4ba6625b8b81e7203cf6f703e4080423d
MD5 1d0727536cf51f8f362cba77a3ba26c5
BLAKE2b-256 49a0623379ff2d2875f39a9bc9e8f45288db229b9dda0899902a0874b8ba30af

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