{
  "slug": "data-reshape",
  "name": "gizza-ai/data-reshape",
  "version": "0.1.0",
  "title": "Data Reshape — Query & Transform JSON, YAML, CSV, XML — gizza.ai",
  "description": "Parse JSON, YAML, CSV, or XML and reshape it with JSONata into new JSON or YAML — filter, aggregate, and restructure in one browser-local step.",
  "tags": [
    "data reshape",
    "jsonata",
    "transform json",
    "csv to json",
    "xml to json",
    "yaml transform",
    "query data",
    "restructure data",
    "data transformer"
  ],
  "category": "utilities",
  "urls": {
    "page": "https://gizza.ai/tools/data-reshape/",
    "markdown": "https://gizza.ai/tools/data-reshape/index.md",
    "descriptor": "https://gizza.ai/tools/data-reshape/tool.json",
    "deep_link_example": "https://gizza.ai/tools/data-reshape/?data=name%2Cprice%0Aapple%2C2%0Abanana%2C3%0Acherry%2C5&query=%7B%20%22total%22%3A%20%24sum%28%24.price%29%2C%20%22items%22%3A%20%24count%28%24%29%20%7D&input_format=auto&output_format=json&pretty=true"
  },
  "cli": "gizza tool data-reshape \"name,price\napple,2\nbanana,3\ncherry,5\" 'query={ \"total\": $sum($.price), \"items\": $count($) }'",
  "tool": {
    "description": "Parse a document in JSON, YAML, CSV, or XML and reshape it with a JSONata expression into a new structured result (JSON or YAML). JSONata is one language for both querying (navigate paths, filter with predicates, aggregate with $sum/$count/$max) and templating (construct new objects/arrays like '{ \"total\": $sum(lines.amount) }'). CSV parses to an array of row objects (numeric/boolean cells coerced); XML/YAML map to nested objects. Set input_format=auto to sniff the format. A query that matches nothing returns null. Runs locally, pure-Rust engine.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "data": {
          "description": "The source document to reshape (JSON, YAML, CSV, or XML).",
          "type": "string"
        },
        "input_format": {
          "default": "auto",
          "description": "Format of the input document. 'auto' sniffs it (< → XML, {/[ → JSON, a comma header → CSV, else YAML).",
          "enum": [
            "auto",
            "json",
            "yaml",
            "csv",
            "xml"
          ],
          "type": "string"
        },
        "output_format": {
          "default": "json",
          "description": "Format of the reshaped result. Default json.",
          "enum": [
            "json",
            "yaml"
          ],
          "type": "string"
        },
        "pretty": {
          "default": true,
          "description": "Indent the JSON output (ignored for YAML). Default true.",
          "type": "boolean"
        },
        "query": {
          "description": "The JSONata expression that queries and/or templates the data, e.g. '$sum(items.price)', 'items[price > 10].name', or '{ \"total\": $sum(lines.amount) }'. CSV rows arrive as an array of objects; XML/YAML map to nested objects.",
          "type": "string"
        }
      },
      "required": [
        "data",
        "query"
      ],
      "type": "object"
    }
  }
}