csvtojsonify 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ # MANIFEST.in
2
+ include csvtojsonify.py
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.1
2
+ Name: csvtojsonify
3
+ Version: 1.0.0
4
+ Summary: A tool to convert CSV to JSON
5
+ Home-page: UNKNOWN
6
+ Author: Sriram Sreedhar
7
+ Author-email: sriramsreedhar003@email.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+
11
+ UNKNOWN
12
+
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.1
2
+ Name: csvtojsonify
3
+ Version: 1.0.0
4
+ Summary: A tool to convert CSV to JSON
5
+ Home-page: UNKNOWN
6
+ Author: Sriram Sreedhar
7
+ Author-email: sriramsreedhar003@email.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+
11
+ UNKNOWN
12
+
@@ -0,0 +1,8 @@
1
+ MANIFEST.in
2
+ csvtojsonify.py
3
+ setup.py
4
+ csvtojsonify.egg-info/PKG-INFO
5
+ csvtojsonify.egg-info/SOURCES.txt
6
+ csvtojsonify.egg-info/dependency_links.txt
7
+ csvtojsonify.egg-info/entry_points.txt
8
+ csvtojsonify.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ csvtojsonify = csvtojsonify:main
3
+
@@ -0,0 +1 @@
1
+ csvtojsonify
@@ -0,0 +1,27 @@
1
+ import csv
2
+ import json
3
+
4
+ # Prompt user for input file name
5
+ input_file = input("Enter the input CSV file name: ")
6
+
7
+ # Check if input file name ends with ".csv"
8
+ if not input_file.endswith(".csv"):
9
+ print("Error: Input file name must end with '.csv'")
10
+ exit(1)
11
+
12
+ # Prompt user for output file name
13
+ output_file = input("Enter the output JSON file name: ")
14
+
15
+ # Check if output file name ends with ".json"
16
+ if not output_file.endswith(".json"):
17
+ print("Error: Output file name must end with '.json'")
18
+ exit(1)
19
+
20
+ with open(input_file, 'r') as csvfile:
21
+ reader = csv.reader(csvfile)
22
+ data = list(reader)
23
+
24
+ with open(output_file, 'w') as jsonfile:
25
+ json.dump(data, jsonfile)
26
+
27
+ print(f"Conversion successful! The new JSON file is {output_file}")
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,16 @@
1
+ # setup.py
2
+ from setuptools import setup
3
+
4
+ setup(
5
+ name='csvtojsonify',
6
+ version='1.0.0',
7
+ packages=['csvtojsonify'],
8
+ entry_points={
9
+ 'console_scripts': [
10
+ 'csvtojsonify = csvtojsonify:main',
11
+ ],
12
+ },
13
+ author='Sriram Sreedhar',
14
+ author_email='sriramsreedhar003@email.com',
15
+ description='A tool to convert CSV to JSON',
16
+ )