skillfed

pycobertura

"A Cobertura coverage parser that can diff reports and show coverage progress."

pycobertura v4.1.0 468.0K downloads/30d#6,494 on PyPI129
Permissive license AGING released

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 pycobertura

uv

uv add pycobertura

poetry

poetry add pycobertura

Installing 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"

License :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

cobertura coverage diffcoverage report parsercode coverage comparisoncoverage regression detectioncobertura xml analysiscoverage metrics reportingtest coverage tracking
coverage-testingci-cd-integrationcode-metrics

More Python Modules packages