Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/dicttoxml@1.7.x
tile.json

tessl/pypi-dicttoxml

tessl install tessl/pypi-dicttoxml@1.7.0

Converts 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%

task.mdevals/scenario-4/

Catalog XML Builder

Produce an XML document from a list of product dictionaries, returning either bytes for transport or text for logging without manual encoding work.

Capabilities

Byte payload for services

  • Given product entries with names and prices, calling the builder with defaults returns UTF-8 XML as bytes, rooted at catalog with one child element per product. @test

Text payload for logs

  • When as_text=True, the same input returns a Python string containing the XML, preserving characters like Cafe Latte without encoding errors. @test

Consistent content across formats

  • The string produced with as_text=True matches the decoded content of the default byte output aside from the return type. @test

Implementation

@generates

API

from typing import List, Dict, Union

def build_catalog_xml(products: List[Dict], *, as_text: bool = False, root: str = "catalog") -> Union[bytes, str]:
    ...

Dependencies { .dependencies }

dicttoxml { .dependency }

Provides XML serialization of Python objects.