Update app.py
Browse files
app.py
CHANGED
|
@@ -49,17 +49,18 @@ def get_csv_file(csv_docs):
|
|
| 49 |
|
| 50 |
def get_json_file(json_docs):
|
| 51 |
temp_dir = tempfile.TemporaryDirectory()
|
| 52 |
-
|
| 53 |
-
temp_filepath=os.path.join(temp_dir.name, json_docs.name),
|
| 54 |
-
jq_schema='.',
|
| 55 |
-
text_content=False
|
| 56 |
-
)
|
| 57 |
with open(temp_filepath,"wb") as f:
|
| 58 |
s = f.write(json_docs.getvalue())
|
| 59 |
s = s.replace('\t','')
|
| 60 |
s = s.replace('\n','')
|
| 61 |
s = s.replace(',}','}')
|
| 62 |
s = s.replace(',]',']')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
json_doc = json_loader.load()
|
| 64 |
return json_doc
|
| 65 |
|
|
|
|
| 49 |
|
| 50 |
def get_json_file(json_docs):
|
| 51 |
temp_dir = tempfile.TemporaryDirectory()
|
| 52 |
+
temp_filepath=os.path.join(temp_dir.name, json_docs.name)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
with open(temp_filepath,"wb") as f:
|
| 54 |
s = f.write(json_docs.getvalue())
|
| 55 |
s = s.replace('\t','')
|
| 56 |
s = s.replace('\n','')
|
| 57 |
s = s.replace(',}','}')
|
| 58 |
s = s.replace(',]',']')
|
| 59 |
+
json_loader=JSONLoader(
|
| 60 |
+
temp_filepath=os.path.join(temp_dir.name, json_docs.name),
|
| 61 |
+
jq_schema='.',
|
| 62 |
+
text_content=False
|
| 63 |
+
)
|
| 64 |
json_doc = json_loader.load()
|
| 65 |
return json_doc
|
| 66 |
|