08-14-2026, 01:52 PM
Three ways, from quickest to most control:
1. pandas
2. csv + json modules (no dependencies)
3. DF Toolbox – for quick one-off conversions the CSV ⇄ JSON converter on tools.php does both directions instantly, no code needed.
Watch out for: encoding (use encoding='utf-8'), and numbers stored as strings (convert them explicitly).
How do you handle the CSV → JSON step in your pipelines – code, tooling, or both?
1. pandas
Code:
import pandas as pd
df = pd.read_csv('data.csv')
df.to_json('data.json', orient='records')2. csv + json modules (no dependencies)
Code:
import csv, json
with open('data.csv') as f:
rows = list(csv.DictReader(f))
with open('data.json', 'w') as f:
json.dump(rows, f, indent=2)3. DF Toolbox – for quick one-off conversions the CSV ⇄ JSON converter on tools.php does both directions instantly, no code needed.
Watch out for: encoding (use encoding='utf-8'), and numbers stored as strings (convert them explicitly).
How do you handle the CSV → JSON step in your pipelines – code, tooling, or both?
