Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import streamlit as st
|
3 |
+
json_file = st.text_input("Enter the path: ")
|
4 |
+
if json_file:
|
5 |
+
try:
|
6 |
+
with open(json_file, encoding='utf-8') as inputFile:
|
7 |
+
df = pd.read_json(inputFile)
|
8 |
+
st.write("Json file has loaded successfully")
|
9 |
+
except FileNotFoundError:
|
10 |
+
st.write("File not found, please make sure the file path is correct.")
|
11 |
+
locate_csv_file=st.text_input("enter the path to save CSV file : ")
|
12 |
+
if locate_csv_file:
|
13 |
+
try:
|
14 |
+
df.to_csv(locate_csv_file, encoding='utf-8', index=False)
|
15 |
+
st.write("CSV file saved successfully!")
|
16 |
+
except Exception:
|
17 |
+
st.write("Error has occurred ",Exception)
|