tessl install tessl/pypi-dicttoxml@1.7.0Converts a Python dictionary or other native data type into a valid XML string.
Agent Success
Agent success rate when using this tile
86%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.99x
Baseline
Agent success rate without this tile
87%
Create an XML document from order records, ensuring the payload is wrapped in an outer element that can use either a default tag or a caller-provided name. Sample input used across tests:
[
{"order_id": 101, "customer": "Ada", "items": ["pen", "paper"]},
{"order_id": 102, "customer": "Lin", "items": ["stapler"]}
]@generates
from typing import Iterable, Mapping, Any, Union
def export_orders(records: Iterable[Mapping[str, Any]], root_tag: str | None = None, as_bytes: bool = True) -> Union[bytes, str]:
"""Convert order records into an XML document with an outer wrapper element."""Converts Python objects into XML documents with configurable wrapping.