xmacro
a simple XML macro tool
Decision gist · record as of 2026-08-14
Yes, if you need XML macro expansion for URDF or SDF files and are comfortable with an abandoned package. The tool is simple, has no dependencies, and works well for its stated purpose. However, do not use it for untrusted or adversarial input due to eval()-based expression evaluation, and be aware that no security patches or feature updates will be released.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward via pip with no runtime dependencies.
- However, the package is abandoned—last release was in January 2022 and the repository received its final commit in September 2022, so no active maintenance or security updates should be expected.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and places no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2022-01-18 (1669 days) · last repo commit 2022-09-18 · 15 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 77,532 downloads/mo, #14,517 on PyPI
Alternatives
Verify before relying
# Command-line usage
pip install xmacro
xmacro input.xml.xmacro > output.xml
# Python API usage
from xmacro.xmacro import XMLMacro
xmacro = XMLMacro()
xmacro.set_xml_file('input.xml.xmacro')
xmacro.generate()
xmacro.to_file('output.xml')- Whether the package works reliably with modern Python versions given its abandonment status
- Whether math expression evaluation via eval() poses security risks in untrusted input scenarios
What it is and what it does
xmacro is a simplified XML macro language inspired by ROS's xacro, designed to preprocess URDF and SDF robot description files. It runs independently of ROS and can be installed via pip. The tool supports value macros (named constants substituted into XML), block macros (parameterized XML fragments), math expressions within substitution braces, file inclusion, and conditional blocks. It provides both a command-line interface and a Python API for integration into build or launch workflows.
The package includes two specialized variants: xmacro4sdf and xmacro4urdf, which add pre-defined geometry and inertia macros specific to each format, along with path resolution for model:// and package:// URIs. Macro nesting is supported up to 5 levels deep. The implementation uses Python's eval() for expression evaluation, which the documentation notes is unsafe for untrusted input.
Use it for
- Reduce duplication in URDF robot descriptions by defining reusable inertia and geometry macros for common shapes
- Generate multiple SDF model variants from a single template by overriding macro values at parse time
- Preprocess robot description files in ROS 2 launch scripts using the Python API before deployment
- Conditionally include or exclude robot components based on macro parameters without manual file editing
- Include common macro definitions across multiple URDF or SDF files via the xmacro_include tag
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need XML macro expansion for URDF or SDF files and are comfortable with an abandoned package.
The tool is simple, has no dependencies, and works well for its stated purpose. However, do not use it for untrusted or adversarial input due to eval()-based expression evaluation, and be aware that no security patches or feature updates will be released.
Install
xmacro on PyPI
Before you install
Installation is straightforward via pip with no runtime dependencies. However, the package is abandoned—last release was in January 2022 and the repository received its final commit in September 2022, so no active maintenance or security updates should be expected.
License in practice
MIT license is permissive and places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
# Command-line usage
pip install xmacro
xmacro input.xml.xmacro > output.xml
# Python API usage
from xmacro.xmacro import XMLMacro
xmacro = XMLMacro()
xmacro.set_xml_file('input.xml.xmacro')
xmacro.generate()
xmacro.to_file('output.xml')
Verify before relying
- Whether the package works reliably with modern Python versions given its abandonment status
- Whether math expression evaluation via eval() poses security risks in untrusted input scenarios
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,669 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,532 / month, #14,517 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: xmacro-1.2.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “urdf macro preprocessor”
- xmacroxmacro is a command-line and Python tool for defining and expanding…
- pcppA pure Python implementation of a C99 preprocessor that can…
- fyppFypp is a Python-powered preprocessor for Fortran that adds…
Give your agent the search over MCP, or paste the wish link into any chat.
More Markup packages
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.
Install it if you need reliable markdown-to-HTML conversion.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.
Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.
Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.
Install it if you're building tools that touch TOML files and user readability of the source matters.
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
See also xacro · cmeel-urdfdom · zope.tal · robot_descriptions · urdf-usd-converter · uri-template · junitparser · defusedxml · yourdfpy · clvm-tools