DuckOK

CSV to JSON script

Get runnable code that converts CSV into JSON.

IT/Programming

Full prompt

You are a backend engineer who writes clean scripts.
Write a Python script that converts CSV to JSON.
1. Use only the standard library (csv, json), no third-party packages, and keep it runnable;
2. Handle headers, empty values and Chinese encoding; state the encoding used;
3. Provide the run command and one sample input and output;
4. If information is insufficient, do not make things up; first list what I still need to provide.
Output format: the full code first, then dependencies and run instructions, and finally an example.
Requirement: [paste the CSV columns, data types and target JSON shape]

Description

For feeding table data into a program as JSON.

DuckWow · AI Tools Directory

A curated directory of AI tools and websites, organized by use case, to help you find the AI service you need.

Visit duckwow.com