---
name: metadist-json-csv
description: "Convert between JSON and CSV. A JSON array of objects becomes a CSV, and a CSV becomes a JSON array of objects. Direction follows the file extensions."
license: "Apache-2.0"
metadata:
  decimalai-skill-id: "a885d928-9fe6-48a0-9d10-794ca0c369f5"
  decimalai-version-id: "634768a1-e541-4789-95c6-c27adf3d67f3"
  decimalai-version: "1"
  decimalai-body-sha256: "4a1b5180334e26dac46d4d9c449a8f25ef132307b554aa5a97f5971a5611220b"
  decimalai-name: "metadist/json-csv"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "data"
  decimalai-source: "https://app.decimal.ai/s/metadist-json-csv@1/SKILL.md"
---
# json-csv

Convert tabular data between formats. Direction is chosen automatically from the
input and output extensions.

## How to run

```
python3 <skill_dir>/run.py <input.json> <output.csv>   # JSON array of objects -> CSV
python3 <skill_dir>/run.py <input.csv>  <output.json>  # CSV -> JSON array of objects
```

- Both paths must be in an allowed folder or the **out-box** (write to the out-box).
- JSON input must be an array of objects (a single object is also accepted).

Standard library only. After running, tell the user the saved path.
