{"id":5163,"library":"coverage-badge","title":"Coverage Badge","description":"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`.","status":"maintenance","version":"1.1.2","language":"en","source_language":"en","source_url":"https://github.com/dbrgn/coverage-badge","tags":["coverage","badge","testing","reports","ci/cd","svg","python"],"install":[{"cmd":"pip install coverage-badge","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"The core functionality of coverage-badge relies on coverage.py to generate test coverage data (.coverage file). It is not a direct Python dependency but a prerequisite for operation.","package":"coverage","optional":false}],"imports":[],"quickstart":{"code":"# 1. Run Coverage.py to generate coverage data\n# (Example with pytest, ensure pytest-cov is installed if using pytest)\n# pip install coverage pytest pytest-cov\ncoverage run -m pytest\n\n# 2. Generate the coverage badge SVG file\n#    Ensure you run this command from the directory where the .coverage data file is located.\ncoverage-badge -o coverage.svg\n\n# The coverage.svg file is now generated and can be embedded in your README.md\n# Example markdown: ![Coverage](coverage.svg)","lang":"bash","description":"To generate a coverage badge, first run `Coverage.py` (e.g., via `pytest --cov`) to produce coverage data. Then, execute `coverage-badge` in the same directory as the `.coverage` data file to generate the SVG image."},"warnings":[{"fix":"Consider migrating to `genbadge` for new projects or if advanced features are required.","message":"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.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Navigate to the correct directory using `cd` before running `coverage-badge`, or specify the path to the `.coverage` file if the tool supported it (which it doesn't currently, based on documentation).","message":"The `coverage-badge` command must be run from the directory where the `.coverage` data file (generated by `Coverage.py`) is located.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always run `coverage run ...` (e.g., `coverage run -m pytest`) before attempting to generate the badge with `coverage-badge`.","message":"`coverage-badge` requires `Coverage.py` to have been run previously to generate a `.coverage` data file. Without this file, the badge cannot be generated.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}