Coverage Badge
coverage-badge is a Python utility that generates SVG coverage badges based on data produced by the `Coverage.py` tool. While it currently stands at version 1.1.2, the project is in maintenance mode, meaning it will receive only occasional updates and fixes, but no new features. Users seeking more advanced features or active development are encouraged to explore alternatives like `genbadge`.
Warnings
- deprecated The `coverage-badge` project is in maintenance mode and will not receive new features. It is recommended to use `genbadge` for more features and active development.
- gotcha The `coverage-badge` command must be run from the directory where the `.coverage` data file (generated by `Coverage.py`) is located.
- gotcha `coverage-badge` requires `Coverage.py` to have been run previously to generate a `.coverage` data file. Without this file, the badge cannot be generated.
Install
-
pip install coverage-badge
Quickstart
# 1. Run Coverage.py to generate coverage data # (Example with pytest, ensure pytest-cov is installed if using pytest) # pip install coverage pytest pytest-cov coverage run -m pytest # 2. Generate the coverage badge SVG file # Ensure you run this command from the directory where the .coverage data file is located. coverage-badge -o coverage.svg # The coverage.svg file is now generated and can be embedded in your README.md # Example markdown: 