|
import streamlit as st |
|
import zipfile |
|
import os |
|
|
|
|
|
def unzip_file(zip_file_path, extract_to_path): |
|
|
|
if not os.path.exists(extract_to_path): |
|
os.makedirs(extract_to_path) |
|
|
|
|
|
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref: |
|
zip_ref.extractall(extract_to_path) |
|
|
|
st.success(f"Files have been extracted to: {extract_to_path}") |
|
|
|
|
|
zip_file_path = "cspc_db.zip" |
|
extract_to_path = "cspc_db" |
|
|
|
|
|
if st.button('Unzip CSPC Database'): |
|
unzip_file(zip_file_path, extract_to_path) |
|
st.write(f"Unzipped files are available in the '{extract_to_path}' folder.") |
|
|