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.
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/PKG-INFO +1 -1
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify.egg-info/PKG-INFO +1 -1
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify.py +6 -3
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/setup.py +1 -1
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/MANIFEST.in +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/README.md +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify/__init__.py +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify.egg-info/SOURCES.txt +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify.egg-info/dependency_links.txt +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify.egg-info/entry_points.txt +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/csvtojsonify.egg-info/top_level.txt +0 -0
- {csvtojsonify-1.2.0 → csvtojsonify-1.3.0}/setup.cfg +0 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|