From 342a04074a1ba404650b6cf45ddc2fc9abe98a6b Mon Sep 17 00:00:00 2001 From: Gareth Date: Thu, 19 Dec 2024 07:13:09 +0000 Subject: [PATCH 1/5] py file added --- main.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..e69de29 From be663fc9a2d67ad50d44efc55d12802ad2092e11 Mon Sep 17 00:00:00 2001 From: Gareth Date: Thu, 19 Dec 2024 07:16:36 +0000 Subject: [PATCH 2/5] skeleton --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index e69de29..8acef98 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,8 @@ +import json + +with open("./data.csv", "r").read() as data: + #your code here + + + + #end of your code here \ No newline at end of file From 5f2f72c6816771e7190227eb0edeec25391bd784 Mon Sep 17 00:00:00 2001 From: Gareth Date: Thu, 19 Dec 2024 08:00:15 +0000 Subject: [PATCH 3/5] setup complete --- main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 8acef98..06a8145 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,13 @@ import json -with open("./data.csv", "r").read() as data: +items = [] + +with open("./data.csv", "r", encoding="utf-8") as data: #your code here + pass + #end of your code here +with open("./output.json", "w") as file: + var_to_dump = {"items": items} - - #end of your code here \ No newline at end of file + json.dump(var_to_dump, file, ensure_ascii=False) \ No newline at end of file From 62c9e4646a323e54033d119476d34db78b83d2af Mon Sep 17 00:00:00 2001 From: Gareth James <81640442+gareth5james@users.noreply.github.com> Date: Thu, 19 Dec 2024 08:33:15 +0000 Subject: [PATCH 4/5] Delete index.js --- index.js | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 index.js diff --git a/index.js b/index.js deleted file mode 100644 index 24ea26c..0000000 --- a/index.js +++ /dev/null @@ -1,18 +0,0 @@ -const fs = require("fs"); - -const data = fs.readFileSync("./data.csv", "utf-8"); - -const output = { - //your code here - - - - - - - - - //end of your code here -}; - -fs.writeFileSync("./output.json", JSON.stringify(output)); \ No newline at end of file From 64d5db7c855760ca0f5be0265265c0972d9c2bd5 Mon Sep 17 00:00:00 2001 From: Gareth Date: Thu, 19 Dec 2024 15:10:33 +0000 Subject: [PATCH 5/5] remove node json file --- package.json | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 package.json diff --git a/package.json b/package.json deleted file mode 100644 index b3cde48..0000000 --- a/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "datatest", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -}