mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
1.9 KiB
1.9 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| Converte tra CSV e JSON, in entrambe le direzioni. | 978c08ad46d3 | human | f7113d2bf1c6 |
CSV to JSON
Converte tra i formati CSV e JSON in entrambe le direzioni. Carica un file CSV o TSV per ottenere un array JSON di oggetti, oppure carica un array JSON per ottenere un file CSV.
API Endpoint
POST /api/v1/tools/files/csv-json
Accetta dati form multipart con un file CSV, TSV o JSON e un campo JSON settings.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| pretty | boolean | No | true |
Formatta l'output JSON con indentazione |
Example Request
CSV to JSON:
curl -X POST http://localhost:1349/api/v1/tools/files/csv-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@users.csv" \
-F 'settings={"pretty": true}'
JSON to CSV:
curl -X POST http://localhost:1349/api/v1/tools/files/csv-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@users.json" \
-F 'settings={}'
Example Response
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/users.json",
"originalSize": 1500,
"processedSize": 2200
}
Notes
- La direzione della conversione viene rilevata automaticamente dall'estensione del file di input:
.csvo.tsvproduce.json, e.jsonproduce.csv. - Il parametro
prettyinfluisce solo sull'output JSON. Quando impostato sufalse, l'output è una stringa JSON compatta su una sola riga. - L'input JSON deve essere un array di oggetti con chiavi coerenti. Ogni oggetto diventa una riga e ogni chiave diventa un'intestazione di colonna.
- I file TSV (valori separati da tabulazioni) sono supportati insieme a CSV.