Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +8 -4
src/streamlit_app.py
CHANGED
|
@@ -27,6 +27,7 @@ import pandas as pd
|
|
| 27 |
from streamlit_drawable_canvas import st_canvas
|
| 28 |
import pytesseract
|
| 29 |
import numpy as np
|
|
|
|
| 30 |
|
| 31 |
# Set Tesseract path - auto-detect based on OS
|
| 32 |
if os.name == 'nt': # Windows
|
|
@@ -302,6 +303,9 @@ elif st.session_state.page == 'viewer':
|
|
| 302 |
st.session_state.save_message = None
|
| 303 |
st.session_state.save_message_time = None
|
| 304 |
|
|
|
|
|
|
|
|
|
|
| 305 |
# Header with back button and download options
|
| 306 |
col1, col2, col3, col4 = st.columns([1, 2, 2, 2])
|
| 307 |
|
|
@@ -322,7 +326,7 @@ elif st.session_state.page == 'viewer':
|
|
| 322 |
st.download_button(
|
| 323 |
label=f"⬇️ Download Modified ({len(modified_data)})",
|
| 324 |
data=jsonl_modified,
|
| 325 |
-
file_name="
|
| 326 |
mime="application/jsonl",
|
| 327 |
type="primary",
|
| 328 |
use_container_width=True
|
|
@@ -344,7 +348,7 @@ elif st.session_state.page == 'viewer':
|
|
| 344 |
st.download_button(
|
| 345 |
label=f"⬇️ Download Unmodified ({len(unmodified_data)})",
|
| 346 |
data=jsonl_unmodified,
|
| 347 |
-
file_name="
|
| 348 |
mime="application/jsonl",
|
| 349 |
use_container_width=True
|
| 350 |
)
|
|
@@ -359,9 +363,9 @@ elif st.session_state.page == 'viewer':
|
|
| 359 |
with col4:
|
| 360 |
jsonl_all = save_to_jsonl(st.session_state.edited_data)
|
| 361 |
st.download_button(
|
| 362 |
-
|
| 363 |
data=jsonl_all,
|
| 364 |
-
file_name="
|
| 365 |
mime="application/jsonl",
|
| 366 |
use_container_width=True
|
| 367 |
)
|
|
|
|
| 27 |
from streamlit_drawable_canvas import st_canvas
|
| 28 |
import pytesseract
|
| 29 |
import numpy as np
|
| 30 |
+
from datetime import datetime
|
| 31 |
|
| 32 |
# Set Tesseract path - auto-detect based on OS
|
| 33 |
if os.name == 'nt': # Windows
|
|
|
|
| 303 |
st.session_state.save_message = None
|
| 304 |
st.session_state.save_message_time = None
|
| 305 |
|
| 306 |
+
# Get today's date for filename
|
| 307 |
+
today_date = datetime.now().strftime("%Y-%m-%d")
|
| 308 |
+
|
| 309 |
# Header with back button and download options
|
| 310 |
col1, col2, col3, col4 = st.columns([1, 2, 2, 2])
|
| 311 |
|
|
|
|
| 326 |
st.download_button(
|
| 327 |
label=f"⬇️ Download Modified ({len(modified_data)})",
|
| 328 |
data=jsonl_modified,
|
| 329 |
+
file_name=f"modified_remittance_data_{today_date}.jsonl",
|
| 330 |
mime="application/jsonl",
|
| 331 |
type="primary",
|
| 332 |
use_container_width=True
|
|
|
|
| 348 |
st.download_button(
|
| 349 |
label=f"⬇️ Download Unmodified ({len(unmodified_data)})",
|
| 350 |
data=jsonl_unmodified,
|
| 351 |
+
file_name=f"unmodified_remittance_data_{today_date}.jsonl",
|
| 352 |
mime="application/jsonl",
|
| 353 |
use_container_width=True
|
| 354 |
)
|
|
|
|
| 363 |
with col4:
|
| 364 |
jsonl_all = save_to_jsonl(st.session_state.edited_data)
|
| 365 |
st.download_button(
|
| 366 |
+
label=f"⬇️ Download All ({len(st.session_state.edited_data)})",
|
| 367 |
data=jsonl_all,
|
| 368 |
+
file_name=f"all_remittance_data_{today_date}.jsonl",
|
| 369 |
mime="application/jsonl",
|
| 370 |
use_container_width=True
|
| 371 |
)
|