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%
Generate an XML document for audit records where every element is annotated with its original Python type and date/boolean values are normalized for downstream consumers.
id=7, active=True, and created_at=datetime(2024, 1, 3, 15, 45, tzinfo=timezone.utc) returns an XML string where each element includes a type attribute, booleans render as true/false, and the datetime uses ISO-8601 with its timezone offset. @test{"flags": {"beta": False}, "window": {"start": datetime(2023, 12, 1, 8, 0, 0), "end": datetime(2023, 12, 1, 9, 0, 0)}}, the generated XML nests those sections and retains type annotations for all inner elements, with datetime values formatted in ISO-8601. @test@generates
from datetime import datetime, timezone
from typing import Iterable, Mapping, Any
def build_audit_xml(records: Iterable[Mapping[str, Any]]) -> str:
"""Return an XML document string that type-annotates elements and normalizes datetimes/booleans."""Converts Python objects to XML while adding type attributes and normalizing datetime/boolean values. @satisfied-by