This might be a stupid question but Im new to python and new to streamlit.
Trying to make an app that would let the user select a local .tgz archive using the st.file_uploader. The file changes from use to use but the content will keep a strict format - I want the app to parse and display the information.
The 2nd-part I’ve figured out using pandas - my issue is with streamlit and the st.file_uploader - How do I interact with the object that is uploaded in a correct way - the object will as I said always be a .tgz archive with strict formatting.
The code looks like this at the moment - trying to extract the tgz using tarfile.
with sidebar: st.sidebar.title("Selection:") st.sidebar.subheader("Select a .tgz ") file = st.sidebar.file_uploader("Fileselector", type="tgz") if not file == None: st.sidebar.write(file) tar = tarfile.open(file) tar.extractall() st.write(tar) else: st.sidebar.write("No file selected")
Getting stuck with this error:
“TypeError: expected str, bytes or os.PathLike object, not UploadedFile”
Thanks in advance.