Spaces:
Runtime error
Runtime error
import modules | |
import streamlit as st | |
from streamlit_extras.let_it_rain import rain | |
# Options | |
DISCLAIMER = "*Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam urna sem, bibendum efficitur pellentesque a, sollicitudin pharetra urna. Nam vel lectus vitae elit luctus feugiat a a purus. Aenean mollis quis ipsum sed ornare. Nunc sit amet ultricies tellus. Vivamus vulputate sem id molestie viverra. Etiam egestas lobortis enim, sit amet lobortis ligula sollicitudin vel. Nunc eget ipsum sollicitudin, convallis.*" | |
# Cleaning parameters | |
drop_missing = None, | |
remove_duplicates = None, | |
# Anonymizing parameters | |
anonymize_data = None | |
# Page Config | |
st.set_page_config(layout="wide") | |
# Default Sidebar | |
with st.sidebar: | |
st.header("2hack2furious anonymiser",) | |
with st.container() as upload: | |
file = st.file_uploader(f"Upload dataset:", type=modules.SUPPORTED_TYPES) | |
df, (filename, extension), result = modules.load_file(file) | |
# Main | |
if df is None: | |
rain("🤠") | |
else: | |
st.dataframe(df) | |
df = modules.data_cleaner(df, drop_missing, remove_duplicates) | |
st.dataframe(df) | |
download_file = modules.create_file(df, extension) | |
with st.sidebar: | |
with st.container() as cleaning_options: | |
st.markdown("Data cleaning options:") | |
drop_missing = st.checkbox("Drop Missing", value=True) | |
remove_duplicates = st.checkbox("Remove Duplicates", value=True) | |
with st.container() as anonymizing_options: | |
st.markdown("Anonymizing options:") | |
anonymize_data = st.checkbox("Anonymize data", value=True) | |
if df is not None: | |
st.download_button("Download cleaned data", download_file, file_name=filename) | |
st.markdown( | |
f""" | |
Disclaimer: | |
{DISCLAIMER} | |
Created by team #2hack2furious for the hackthethreat2023 | |
""" | |
) |