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 a helper that converts Python data structures to XML while letting callers direct verbose conversion logs to a specific file. The utility should keep conversions simple for callers who just want XML output, while exposing an opt-in debug switch that streams detailed logging to a chosen path.
{"id": 7, "status": "ok"} and a writable log path, converting with debugging enabled returns XML bytes containing the fields and leaves a log file at that path with at least one non-empty line. @test@generates
from pathlib import Path
from typing import Any
def convert_with_logging(payload: Any, log_path: str | Path, *, debug: bool = True) -> bytes:
"""Converts the payload to XML bytes, directing debug output to the chosen log file when enabled."""Provides XML generation and debug logging support for Python objects.
@satisfied-by