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-8/

Catalog XML Renderer

Convert nested catalog-style data into an XML document that preserves hierarchy across mappings and sequences.

Capabilities

Builds XML with nested collections

  • Given {"departments": [{"name": "Books", "categories": [{"name": "Fiction", "products": ["Novel", "Shorts"]}]}]}, return an XML document rooted at catalog with an XML declaration and type metadata on each element. Nested content should appear as <catalog><departments type="list"><department>...<categories type="list"><category>...<products type="list"><product>Novel</product><product>Shorts</product></products></category></categories></department></departments></catalog>, preserving the hierarchy. @test

Customizable root and metadata

  • When called with root_tag="inventory", include_types=False, and as_bytes=False on {"departments": []}, return a string starting with <inventory><departments></departments></inventory> (no type attributes anywhere). @test

Handles empty branches

  • Serializing {"departments": [{"name": "Clothing", "categories": []}, {"name": "Electronics", "categories": [{"name": "Cameras", "products": []}]}]} should produce empty tags for the missing categories/products while keeping enclosing elements (e.g., <categories></categories> and <products></products>) without raising errors. @test

Implementation

@generates

API

from typing import Any, Mapping

def render_catalog_xml(
    data: Mapping[str, Any],
    *,
    root_tag: str = "catalog",
    include_types: bool = True,
    as_bytes: bool = True,
    singularize_items: bool = True,
):
    """Serialize nested catalog data into XML with predictable item naming."""

Dependencies { .dependencies }

dicttoxml { .dependency }

Converts Python mappings and sequences into XML with optional metadata and configurable element naming. @satisfied-by