Skip to content

Commit a2132d7

Browse files
Create readme.md
1 parent b5b8759 commit a2132d7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

CSV to JSON Converter/readme.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CSV to JSON Converter
2+
3+
**Approach**
4+
- import `tkinter`, `csv` and `json`
5+
- create a JSON_file dictionary, each representing a record (row) from the CSV file, with the Key as the column specified.
6+
- use `csv.DictReader()` to read the csv file
7+
- use `jsonfile.write()` to write the data that collected from csv file where `jsonfile` contains the .json file path with write mode
8+
9+
**Demostration**
10+
Sample .csv file :
11+
12+
![image](https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/sample%20csv%20file.png)
13+
14+
15+
GUI looks like below :
16+
17+
![image](https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/gui1.png)
18+
19+
![image](https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/gui2.png)
20+
21+
22+
Output :
23+
24+
![image](https://github.com/vamsikrishnarh7/Play-With-Python/blob/main/CSV%20to%20JSON%20Converter/images/sample%20json%20output.png)

0 commit comments

Comments
 (0)