lcov-cobertura
LCOV to Cobertura XML converter
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-coberturauv
uv add lcov-coberturapoetry
poetry add lcov-coberturaInstalling 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
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
gcovrGcovr processes GCC code coverage data and…
permissive · top 5,000 on PyPI
pycoberturaParses Cobertura code coverage reports and…
permissive · top 15,000 on PyPI
fastcovFastcov generates code coverage reports in…
permissive · top 15,000 on PyPI
pyucisPyUCIS provides a Python API and CLI tools for…
permissive · top 15,000 on PyPI
nosexcoverGenerates Cobertura-style XML coverage reports…
permissive · top 15,000 on PyPI
junit2htmlConverts JUnit or XUnit XML test result files…
permissive · top 5,000 on PyPI
diff-coverCompares test coverage reports against git…
permissive · top 1,000 on PyPI
unittest-xml-reportingA unittest test runner that exports test…
permissive · top 5,000 on PyPI
urdf-usd-converterConverts URDF robot description files into…
permissive · top 15,000 on PyPI
junit-xmlGenerates JUnit XML test result documents…
permissive · top 5,000 on PyPI