Registry / web-framework / streamlit-feedback

streamlit-feedback

JSON →
library0.1.4pypypiunverified

Streamlit-feedback is a Streamlit component that allows developers to easily collect structured or free-form user feedback, such as thumbs up/down, emoji faces, or text comments, directly within their Streamlit applications. It is currently at version 0.1.4 and receives updates for compatibility with new Streamlit versions and feature enhancements, maintaining an active development status.

pip install streamlit-feedback
INSTALL
IMPORT
SIG · STREAMLIT-FEEDBACK
S
streamlit-feedback
web-frameworkpythonv0.1.4
Install
15.9s avg
Import
Disk
455MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 466.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 15.9s · import 0.000s · 436MB
455MB installed
● package 455MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

st_feedback
from streamlit_feedback import st_feedback

This quickstart demonstrates how to integrate `streamlit-feedback` into a basic Streamlit application. It shows both 'thumbs' and 'faces' feedback types, including how to handle the returned feedback and the essential use of the `key` parameter for multiple components. The app must be run using `streamlit run`.

import streamlit as st from streamlit_feedback import st_feedback st.set_page_config(layout="wide") st.header("User Feedback Example") # Basic thumbs up/down feedback feedback_thumbs = st_feedback( feedback_type="thumbs", optional_text_label="Tell us more (optional):" ) if feedback_thumbs: st.success(f"Thumbs Feedback received: {feedback_thumbs}") # In a real application, you would store this feedback (e.g., to a database). else: st.info("Please provide your thumbs feedback.") st.markdown("--- ") # Faces feedback with a custom key st.subheader("Rate your experience") feedback_faces = st_feedback( feedback_type="faces", feedback_options=["😀 Excellent", "🙂 Good", "😐 Neutral", "🙁 Poor", "😞 Very Poor"], key="experience_feedback" # Unique key is crucial for multiple widgets ) if feedback_faces: st.success(f"Faces Feedback received: {feedback_faces}") else: st.info("Please rate your experience.") st.caption("To run this app, save it as `app.py` and execute: `streamlit run app.py`")
Debug
Known issues
gotchaThe `st_feedback` component must be executed within a Streamlit application (`streamlit run your_app.py`). Running the script as a standalone Python file will not display the UI component and may result in errors related to missing Streamlit context.
fix
Always launch your application using the `streamlit run` command.
affects: All
gotchaWhen using `st_feedback` multiple times on the same Streamlit page, each instance *must* be assigned a unique `key` parameter. Failing to do so will cause a `StreamlitAPIException` due to key conflicts.
fix
Provide a unique string for the `key` parameter for every `st_feedback` call, e.g., `st_feedback(..., key='unique_id_1')`.
affects: All
gotchaThe structure of the dictionary returned by `st_feedback` when feedback is submitted varies based on the `feedback_type` (e.g., 'thumbs', 'faces', 'text'). Developers must inspect the `feedback_type` field and conditionally access fields like `score` or `text`.
fix
Always check `feedback_result['feedback_type']` before trying to access `feedback_result['score']` or `feedback_result['text']` to ensure correct data parsing, as not all fields are present for all types.
affects: All
Upgrade
Version history
0.1.4latest on PyPI · released Jan 13, 2025
Audit
Dependencies
streamlitrequiredThis library is a component designed to run exclusively within a Streamlit application and requires Streamlit as its core framework dependency. Version >=1.20.0 is typically required.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
streamlit-feedback — pip install streamlit-feedback · libregistry