Skip to main content

Custom component to perform chunked upload in Streamlit.

Project description

streamlit-chunk-file-uploader

This is a custom component that allows you to split files and send them from your browser to Streamlit.

Installation instructions

pip install streamlit-chunk-file-uploader

Usage instructions

import streamlit as st
from streamlit_chunk_file_uploader import uploader

file = uploader("uploader", key="chunk_uploader", chunk_size=32)
st.write(file)
if file is not None:
    st.download_button(
        "download",
        data=file,
        file_name=file.name,
        type="primary",
    )

About chunk size

When a file is uploaded, the Python script slices it on the browser side with the specified chunk size and sends it as a binary string through setComponentValue.
In addition to the binary string, setComponentValue also transmits information such as upload mode, file name, and file size to be received by the backend.
Therefore, it is important to note that the chunk size and the size of the request may differ.
In cases where there are constraints such as client_max_body_size, it is necessary to set a value slightly smaller than the constraint size, for example, setting it to 31MB if the constraint is 32MB.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit-chunk-file-uploader-0.0.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

File details

Details for the file streamlit-chunk-file-uploader-0.0.1.tar.gz.

File metadata

File hashes

Hashes for streamlit-chunk-file-uploader-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0ec2f24aed2155fda4a956c63b2ba823e94d2bfdfab21816373ff749d858c95e
MD5 821d203f849c8345e8c90d4afa40588e
BLAKE2b-256 b35c8a03d63938a5a306b2ec38ffa80452e2c83b4397ff5635c1ca2f052dffd6

See more details on using hashes here.

File details

Details for the file streamlit_chunk_file_uploader-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_chunk_file_uploader-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91e5f8ad642fc22f0f138b0ee7c20d62b33813a6e8b448e6b5e0ff246b4e0a2b
MD5 9bdd8d078681269fe5226ce87d78cc91
BLAKE2b-256 0d9fb3a671987b397ae9102801c44ec3bab8aa5945bf08be4ba560ed9b5a8975

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page