Track & visualize user inputs to your streamlit app
Project description
streamlit-analytics
👀 Track & visualize user inputs to your streamlit app
This is a small extension for the fantastic streamlit framework. With just one line of code, it tracks and counts all user inputs to your streamlit app and visualizes the results directly in your browser. Think Google Analytics but for streamlit.
Installation
pip install git+https://github.com/jrieke/streamlit-analytics.git
Requires Python 3.6+
How to use it
import streamlit_analytics
with streamlit_analytics.track():
st.text_input("Write something")
st.button("Click me")
That's it! 🎈 All inputs & clicks will now be tracked and counted. Of course, you
can also use any other streamlit component in the with
block (currently supported:
button, text_input, selectbox).
To view the results, append ?analytics=on
to your app's URL
(e.g. http://localhost:8501/?analytics=on). The results are then shown directly below
your app (see image above).
More
-
You can password-protect your analytics results with
streamlit_analytics.track(unsafe_password=...)
. The streamlit app will then ask you for this password. Do not choose an important password here – it is sent without encryption. -
If you don't want a huge
with
block, you can also do:import streamlit_analytics streamlit_analytics.start_tracking() # your streamlit code here streamlit_analytics.stop_tracking()
-
Experimental: You can store analytics results as a json file by passing
save_to_json="path/to/file.json"
tostreamlit_analytics.track
orstreamlit_analytics.stop_tracking
. At the moment, this may lead to problems with concurrency if many users access the site at the same time.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for streamlit-analytics-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3d6df59a912eb39b57cb6039ef3e1331e16d00c17eae9562ecade7e9a1e97d9 |
|
MD5 | b2bd5e30b9e5807fd2a40761fac4d0ef |
|
BLAKE2b-256 | 06509025d91095db4d6a24d5a818c9c5421aee9dbe81546a61316eaa6da4b28d |
Hashes for streamlit_analytics-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67079fea28020808bb3889929a7d91bd4490fa9354f4499fabb2942cf4246905 |
|
MD5 | a58132462249257c2337d570e917ad3a |
|
BLAKE2b-256 | d2348d7b4befa9d61941f204a67401645a53c7829a8870d305e7f28ace4aa91b |