Coverage.py Badge
⚠️ coverage-badge is in maintenance mode. I might still do occasional updates and fixes from time to time, but there will be no added features. Most people using coverage-badge might want to use genbadge instead, which has more features (e.g. test badges, flake8 reports, etc).
A small script to generate coverage badges using Coverage.py.
Example of a generated 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.)
Installation
Run:
pip install coverage-badge
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:
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..
Metadata
Release files for coverage-badge 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| coverage_badge-1.1.2.tar.gz | 6.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coverage_badge-1.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / coverage_badge-1.1.2.tar.gz
| Download URL | coverage_badge-1.1.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe7ed58a3b72dad85a553b64a99e963dea3847dcd0b8ddd2b38a00333618642c
|
|
BLAKE2b-256 checksum How to use checksums |
be8fe92b0a010c76b0da82709838b3f3ae9aec638d0c44dbfb1186a5751f5d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.4
|
Release files / coverage_badge-1.1.2-py2.py3-none-any.whl
| Download URL | coverage_badge-1.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d8413ce51c91043a1692b943616b450868cbeeb0ea6a0c54a32f8318c9c96ff7
|
|
BLAKE2b-256 checksum How to use checksums |
903d5642a1a06191b2e1e0f87a2e824e6d3eb7c32c589a68ed4d1dcbd3324d63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.4
|
Security for coverage-badge 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.