pycobertura
"A Cobertura coverage parser that can diff reports and show coverage progress."
What it is and what it does
pycobertura is a command-line tool and Python library for parsing Cobertura XML coverage reports and computing diffs between two reports. It helps teams prevent code coverage from decreasing by highlighting uncovered changes and comparing coverage metrics across versions. The tool outputs results in multiple formats—plain text, HTML, CSV, JSON, YAML, and GitHub annotations—making it flexible for integration into CI/CD pipelines and reporting workflows.
The package depends on click for CLI scaffolding, jinja2 for HTML templating, lxml for XML parsing, tabulate for formatted table output, and ruamel.yaml for YAML serialization. It runs on Python 3.7 and later and has been in active development since 2014, though releases have slowed in recent months.
Use it for:
- Detect coverage regressions in pull requests by comparing new and old coverage reports in CI/CD pipelines.
- Generate HTML coverage reports with source code highlighting to visualize covered and uncovered lines.
- Export coverage metrics to JSON or YAML for downstream analysis or dashboard integration.
- Create GitHub check annotations from coverage data to surface uncovered changes directly in pull request reviews.
- Parse and summarize Cobertura reports in multiple formats (CSV, Markdown, plain text) for team reporting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses Cobertura code coverage reports and compares two reports to show coverage changes, with output in multiple formats including plain text, HTML, CSV, JSON, YAML, and GitHub annotations.
Yes, if you work with Cobertura reports and need to track coverage changes. The tool is straightforward to install, has no known vulnerabilities, and offers flexible output formats. The aging maintenance status (325 days since last release) is a minor concern for long-term stability, but the repository is not archived and the API is documented as unstable until 1.0, so plan accordingly if you depend on exact behavior across versions.
Install
pycobertura on PyPI
pip
pip install pycoberturauv
uv add pycoberturapoetry
poetry add pycoberturaInstalling pycobertura
Before you install
Low friction install with five common dependencies (click, jinja2, lxml, tabulate, ruamel.yaml). Maintenance status is aging—last release was 325 days ago, though the repository remains active and not archived.
License in practice
Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install pycobertura
pycobertura show coverage.xml
pycobertura diff coverage.old.xml coverage.new.xml --source1 old_src/ --source2 new_src/
Requires Python 3.7 or later; source code directories must be provided to the diff command to properly compute missing line information.
Verify before relying
- Whether the unstable API (noted as subject to change until 1.0) poses a risk for long-term dependency use.
- Performance characteristics when processing large or deeply nested Cobertura XML files.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — click, jinja2, lxml, tabulate, ruamel.yaml |
| Maintenance | aging — 325 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 468,001/month — #6,494 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycobertura-4.1.0-py3-none-any.whl
Keywords: "cobertura, coverage, diff, report, parser, parse, xml"
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
diff-coverCompares test coverage reports against git…
permissive · top 1,000 on PyPI
lcov-coberturaConverts code coverage reports from lcov format…
permissive · top 5,000 on PyPI
gcovrGcovr processes GCC code coverage data and…
permissive · top 5,000 on PyPI
pytest-covA pytest plugin that measures code coverage…
permissive · top 1,000 on PyPI
csv-diffCompares two CSV, TSV, or JSON files and…
permissive · top 15,000 on PyPI
pyucisPyUCIS provides a Python API and CLI tools for…
permissive · top 15,000 on PyPI
pycep-parserParses Azure Bicep infrastructure-as-code files…
permissive · top 5,000 on PyPI
daffCompares two tables and produces a diff summary…
permissive · top 1,000 on PyPI
json-diffCompares two JSON files and generates a JSON…
permissive · top 15,000 on PyPI
pytest-htmlGenerates HTML reports for pytest test results,…
copyleft · top 1,000 on PyPI