skillfed

lcov-cobertura

LCOV to Cobertura XML converter

lcov-cobertura v2.1.1 1.1M downloads/30d#4,308 on PyPI
Permissive license Apache License, Version 2.0 AGING released

What it is and what it does

lcov_cobertura is a format converter that reads code coverage data in lcov format and transforms it into Cobertura XML format. It preserves coverage metrics at multiple levels: package/folder, class/file, function, and individual line and branch coverage.

You can use it as a command-line tool to batch-convert coverage files, or import it as a Python module to integrate coverage transformation into your build pipeline. It supports filtering packages by regex, specifying custom source directories, and optionally demangling C++ function names. The package supports Python 3.8+.

Use it for:

  • Convert lcov reports to Cobertura XML for CI server integration and build stability tracking
  • Aggregate coverage metrics from multiple test runs into a single standardized format
  • Filter and exclude test packages from coverage reports before submitting to CI systems
  • Demangle C++ function names in coverage reports for more readable dashboards
  • Integrate coverage conversion into build scripts without adding heavy external dependencies

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts code coverage reports from lcov format to Cobertura XML format, enabling CI servers to aggregate and analyze coverage metrics across packages, classes, functions, and individual lines.

Yes, if you use lcov-based coverage tools and need to feed results into a system that expects Cobertura XML. The package is lightweight, stable, and has no security vulnerabilities. The 538-day gap since last release is not a concern given the narrow, stable scope of format conversion.

Install

lcov-cobertura on PyPI

pip

pip install lcov-cobertura

uv

uv add lcov-cobertura

poetry

poetry add lcov-cobertura

Installing lcov-cobertura

Before you install

Low install friction with a single lightweight runtime dependency (importlib-metadata). Package is aging (538 days since last release) but marked Production/Stable with latest release on 2025-02-22.

License in practice

Licensed under Apache License, Version 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install lcov_cobertura

from lcov_cobertura import LcovCobertura

LCOV_INPUT = 'SF:foo/file.ext\nDA:1,1\nDA:2,0\nend_of_record\n'
converter = LcovCobertura(LCOV_INPUT)
cobertura_xml = converter.convert()
print(cobertura_xml)

Requires Python 3.8 or later. Optional C++ demangling requires the c++filt system utility.

Verify before relying

  • Actual maintenance activity and community engagement beyond the release date
  • Performance characteristics with large lcov files
  • Completeness of coverage metric support beyond documented metrics

Package facts

License Apache License, Version 2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — importlib-metadata
Maintenance aging — 538 days since the last release
First released
Downloads 1,139,728/month — #4,308 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lcov_cobertura-2.1.1-py3-none-any.whl

Keywords: lcov, cobertura

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Quality AssuranceTopic :: Software Development :: Testing

Tags

lcov to cobertura convertercode coverage format conversionlcov xml convertercoverage report aggregationcobertura xml generatorcoverage metrics transformationcoverage integration
coverage-reportingci-integrationbuild-tools

More Testing packages