--- id: junitparser version: "5.0.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # junitparser — Manipulates JUnit/xUnit Result XML files License: permissive · Maintenance: active · Downloads: 14.1M/mo ## What it is and what it does junitparser is a Python library for working with JUnit/xUnit test result XML files. It lets you parse existing XML reports, modify them programmatically, create new reports from scratch, and merge multiple result files together. The library supports the standard windyroad schema by default and can be extended with additional schemas like xunit2 through imports from submodules. It also provides a command-line interface for common operations like merging and verification. The package has no external runtime dependencies, making it lightweight to install. It supports custom XML attributes and elements through monkey-patching, and allows you to specify alternative XML parsers like lxml for performance optimization. The library is actively maintained and requires Python 3.10 or above in its current version. Use it for: - Merge multiple test result XML files from parallel test runs into a single consolidated report. - Parse existing JUnit XML files to extract test metrics, failure counts, or other metadata for analysis. - Generate JUnit XML reports programmatically from custom test frameworks or CI/CD pipelines. - Modify test result XML files to add properties, change classnames, or update test outcomes. - Support extended test result formats like xunit2 with additional attributes such as interim results or system error logging. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parse, create, and manipulate JUnit/xUnit test result XML files, including merging multiple reports and supporting extended schemas like xunit2. Yes. junitparser is a stable, actively maintained library with zero dependencies, permissive licensing, and no known vulnerabilities. Install it if you need to parse, generate, or manipulate JUnit/xUnit XML test reports. The Python 3.10+ requirement is the only constraint; if you're on an older Python version, use version 4.0.2 instead. ## Install pip install junitparser uv add junitparser poetry add junitparser ## Installing junitparser Before you install: Low friction install with no runtime dependencies. Actively maintained as of July 2026 with recent releases. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install junitparser from junitparser import TestCase, TestSuite, JUnitXml case = TestCase('test_name') suite = TestSuite('suite_name') suite.add_testcase(case) xml = JUnitXml() xml.add_testsuite(suite) xml.write('results.xml') Requires Python 3.10 or above; version 4.0.2 is needed for Python 3.9 or below. Verify before relying: - Whether the package handles all real-world JUnit/xUnit XML variants beyond the windyroad schema and xunit2. - Performance characteristics when parsing or merging very large XML files. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 14.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags junit xml parser, xunit result parsing, test report xml, merge junit files, junit xml creation, test result xml manipulation, xunit2 schema support, test-reporting, xml-parsing, ci-cd [View on SkillFed](https://skillfed.io/packages/junitparser) · [View on PyPI](https://pypi.org/project/junitparser/)