Generate coverage badges for Coverage.py.
Project description
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.)
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..
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file coverage-badge-1.0.1.tar.gz
.
File metadata
- Download URL: coverage-badge-1.0.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 142fd121f3bd14956aff3c45bff6f8bc37bd74c6350626a950ebb6accb24276e |
|
MD5 | c29a8b075acf54c4ff37386133369497 |
|
BLAKE2b-256 | 955c2a63322cc0211c41e8cb2bd7c7d7b183871fe5a9f5239d71d531002fac91 |
File details
Details for the file coverage_badge-1.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: coverage_badge-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3796de21b4e190d38beb8806956946fbdb02fe3a2a7452b460a9cff958009833 |
|
MD5 | 81b954b9050244e0a48a46d9a37539e9 |
|
BLAKE2b-256 | 4b30219e4f992ab6f2b47ce810fdfc4f158c2b61a7a484c6d789f78bbf3fb411 |