Skip to main content

streamlit-custom-component

Streamlit component that allows you to create button to paste image from clipboard.

Videotogif (21)

confirmed that it works with chrome,safari,edge. it doesn't work with firefox

Installation instructions

pip install st_img_pastebutton

or

pip install st_img_pastebutton --upgrade

Usage instructions

import streamlit as st
from st_img_pastebutton import paste
from io import BytesIO
import base64

st.header("Image Clipboard Example")
st.write("Click the button below to upload an image from your clipboard.")

image_data = paste(label="paste from clipboard",key="image_clipboard")

if image_data is not None:
    header, encoded = image_data.split(",", 1)
    binary_data = base64.b64decode(encoded)
    bytes_data = BytesIO(binary_data)
    st.image(bytes_data, caption="Uploaded Image", use_column_width=True)
else:
    st.write("No image uploaded yet.")

run

streamlt run examle.py

Release files for st-img-pastebutton 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for st-img-pastebutton 0.0.6
File Size Uploaded
st_img_pastebutton-0.0.6.tar.gz 424.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for st-img-pastebutton 0.0.6
File Interpreter ABI Platform
st_img_pastebutton-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / st_img_pastebutton-0.0.6.tar.gz

Download URL st_img_pastebutton-0.0.6.tar.gz
Size 424.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fbccd6b3bac0bece7101c0af9efe9359c9947f36be4c20b249bceabab704d1de
BLAKE2b-256 checksum
How to use checksums
ab9751a3819e63e2d69d8f5951700190436996daacb10c7c51e73463de25d527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

Release files / st_img_pastebutton-0.0.6-py3-none-any.whl

Download URL st_img_pastebutton-0.0.6-py3-none-any.whl
Size 824.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77ebe9044fe499ac195d3e6baa98521ebb510ad5573c046247e05074b81acd2f
BLAKE2b-256 checksum
How to use checksums
76d97060e6015326a1c42a8330396613d94ee99bfc23a548b9960966fa2ecd9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page