Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -3
src/streamlit_app.py
CHANGED
|
@@ -66,9 +66,12 @@ def get_parser(fileext: str) -> AbstractParser:
|
|
| 66 |
case ".docx":
|
| 67 |
parser = DocxParser()
|
| 68 |
case ".xls" | ".xlsx" | ".xlsm" | ".xlsb" | ".odf" | ".ods" | ".odt":
|
| 69 |
-
parser = ExcelParser()
|
| 70 |
case ".csv":
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
| 72 |
case _:
|
| 73 |
raise ValueError("File format not supported by ChunkNorris")
|
| 74 |
|
|
@@ -243,7 +246,7 @@ st.sidebar.checkbox(
|
|
| 243 |
|
| 244 |
st.sidebar.select_slider(
|
| 245 |
label="Parse sheets (.csv, .xlsx) as :",
|
| 246 |
-
options=["
|
| 247 |
value="auto",
|
| 248 |
key="sheet_parsers_output_format",
|
| 249 |
label_visibility="visible",
|
|
|
|
| 66 |
case ".docx":
|
| 67 |
parser = DocxParser()
|
| 68 |
case ".xls" | ".xlsx" | ".xlsm" | ".xlsb" | ".odf" | ".ods" | ".odt":
|
| 69 |
+
parser = ExcelParser(output_format=ss.sheet_parsers_output_format)
|
| 70 |
case ".csv":
|
| 71 |
+
output_format: str = ss.sheet_parsers_output_format
|
| 72 |
+
if ss.sheet_parsers_output_format == "auto":
|
| 73 |
+
output_format = "json_lines"
|
| 74 |
+
parser = CSVParser(output_format=output_format)
|
| 75 |
case _:
|
| 76 |
raise ValueError("File format not supported by ChunkNorris")
|
| 77 |
|
|
|
|
| 246 |
|
| 247 |
st.sidebar.select_slider(
|
| 248 |
label="Parse sheets (.csv, .xlsx) as :",
|
| 249 |
+
options=["json_lines", "auto", "markdown_table"],
|
| 250 |
value="auto",
|
| 251 |
key="sheet_parsers_output_format",
|
| 252 |
label_visibility="visible",
|