Csv2json
Python3 csv to json convertor
Install / Use
/learn @oplatek/Csv2jsonREADME
CSV to Json converter
Requires Python 3.4+
Install
pip install csv2json
Usage
From a command line
csv-to-json [-h] [--compact] [--csv_delimiter CSV_DELIMITER]
[--csv_quotechar CSV_QUOTECHAR] [--sort_keys]
[--custom_headers CUSTOM_HEADERS [CUSTOM_HEADERS ...]]
[--remove_empty]
csv_input json_output
A command line example
$ cat file.csv
a,b
1,"foo""bar"
2,baz
$ csv-to-json < file.csv
[
{
"a": "1",
"b": "foo\"bar"
},
{
"a": "2",
"b": "baz"
}
]
As a library
from csv2json import convert, load_csv, save_json
with open('input.csv') as r, open('output.json', 'w') as w:
convert(r, w)
Tests
Run unittests e.g. by
python3 setup.py test
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
