--- id: xacro version: "2.1.1" license: Copyright Robert Haschke, Bielefeld University Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1.… (full text in the JSON record) license_treatment: unclear maintenance: active --- # xacro — xacro is a macro language for XML License: unclear · Maintenance: active · Downloads: 201.8K/mo ## What it is and what it does Xacro is a macro preprocessor for XML that allows you to define reusable templates and macros, then expand them into full XML documents. It reduces repetition and improves readability by letting you write shorter, more maintainable XML source files that are transformed into the final XML output. The package depends only on pyyaml and requires Python 3.8 or later. It is commonly used in robotics and configuration contexts where XML files would otherwise contain significant duplication. You write xacro source files with macro definitions and calls, then process them through xacro to generate the expanded XML output. Use it for: - Generate robot configuration files in ROS by defining reusable component macros instead of repeating XML blocks - Preprocess XML configuration files to reduce boilerplate and improve maintainability across multiple similar configs - Template XML documents where sections repeat with minor parameter variations - Build XML files programmatically using macro definitions rather than string concatenation ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Xacro is an XML macro language that lets you write shorter, more readable XML files by defining macros that expand into larger XML expressions. Yes, if you work with XML files that contain repetition or need templating. The package is actively maintained, has low install friction, and no known vulnerabilities. The unclear license treatment is a minor concern—review the BSD 3-Clause text in the repository to confirm it aligns with your project before committing to it. ## Install pip install xacro uv add xacro poetry add xacro ## Installing xacro Before you install: Low install friction with a single runtime dependency (pyyaml). The package is actively maintained with a recent commit on 2026-04-07 and has been in active development since its first release on 2018-09-18. License in practice: License treatment is unclear; the package uses a BSD 3-Clause-style license text but no SPDX identifier is recorded. You should review the full license text in the repository before use to confirm it meets your project's requirements. Quickstart: pip install xacro import xacro xacro.process_file('input.xacro', output='output.xml') Requires Python 3.8 or later; input file must be a valid xacro XML document with macro definitions or includes. Verify before relying: - Whether the BSD 3-Clause license text is the canonical license or if an SPDX identifier should be assigned - Whether xacro is primarily used within the ROS ecosystem or has broader XML-processing applications ## Package facts - License: Copyright Robert Haschke, Bielefeld University Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1.… (full text in the JSON record) (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 201.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags xml macro language, xml templating, xml code generation, reduce xml boilerplate, xml preprocessing, macro expansion xml, xml reusable components, xml-preprocessing, ros-ecosystem [View on SkillFed](https://skillfed.io/packages/xacro) · [View on PyPI](https://pypi.org/project/xacro/)