csvtojsonify 1.2.0__tar.gz → 1.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: csvtojsonify
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: A tool to convert CSV files to JSON.
5
5
  Home-page: https://github.com/sriramsreedhar/csvtojsonify
6
6
  Author: Sriram Sreedhar
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: csvtojsonify
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: A tool to convert CSV files to JSON.
5
5
  Home-page: https://github.com/sriramsreedhar/csvtojsonify
6
6
  Author: Sriram Sreedhar
@@ -11,7 +11,7 @@ def convert_csv_to_json(csv_file, json_file):
11
11
  with open(json_file, 'w') as jsonfile:
12
12
  json.dump(data, jsonfile)
13
13
 
14
- if __name__ == "__main__":
14
+ def main():
15
15
  # Get the input and output file names from the user
16
16
  csv_file = input("Enter the input CSV file name: ")
17
17
  json_file = input("Enter the output JSON file name: ")
@@ -19,14 +19,17 @@ if __name__ == "__main__":
19
19
  # Check if input file name ends with ".csv"
20
20
  if not csv_file.endswith(".csv"):
21
21
  print("Error: Input file name must end with '.csv'")
22
- exit(1)
22
+ return
23
23
 
24
24
  # Check if output file name ends with ".json"
25
25
  if not json_file.endswith(".json"):
26
26
  print("Error: Output file name must end with '.json'")
27
- exit(1)
27
+ return
28
28
 
29
29
  # Call the conversion function
30
30
  convert_csv_to_json(csv_file, json_file)
31
31
 
32
32
  print("Conversion successful! The new JSON file is", json_file)
33
+
34
+ if __name__ == "__main__":
35
+ main()
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='csvtojsonify',
5
- version='1.2.0',
5
+ version='1.3.0',
6
6
  packages=['csvtojsonify'],
7
7
  entry_points={
8
8
  'console_scripts': [
File without changes
File without changes
File without changes