From ee335a9cdc0afc3327e80e5bf5e620726d5e4cff Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Fri, 8 Mar 2024 08:43:25 +0200 Subject: [PATCH 1/7] Update bug_report.md Update bug template --- .github/ISSUE_TEMPLATE/bug_report.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0490f69..87c8a4a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,11 +4,15 @@ about: Create a report to help us improve title: "[BUG] " labels: bug assignees: '444B' - --- **Describe the bug** A clear and concise description of what the bug is. +- + +**Expected behavior** +A clear and concise description of what you expected to happen. +- **To Reproduce** Steps to reproduce the behavior: @@ -17,22 +21,16 @@ Steps to reproduce the behavior: 3. Scroll down to '....' 4. See error -**Expected behavior** -A clear and concise description of what you expected to happen. +**Software Vesions** +Please fill in the relevant field: +- streamlit_analytics2 : +- streamlit : +- Python3 : **Screenshots** If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] +- **Additional context** Add any other context about the problem here. +- From cf2d61d9d63fb88e85830c187542bca42a96a5a2 Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Fri, 8 Mar 2024 07:43:32 +0000 Subject: [PATCH 2/7] added .download_button, link_button, page_link, .toggle and .camera_input to monkey wrapping --- src/streamlit_analytics2/main.py | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/streamlit_analytics2/main.py b/src/streamlit_analytics2/main.py index ffd25d0..76da754 100644 --- a/src/streamlit_analytics2/main.py +++ b/src/streamlit_analytics2/main.py @@ -47,6 +47,12 @@ def reset_counts(): _orig_time_input = st.time_input _orig_file_uploader = st.file_uploader _orig_color_picker = st.color_picker +# new elements, testing +_orig_download_button = st.download_button +_orig_link_button = st.link_button +_orig_page_link = st.page_link +_orig_toggle = st.toggle +_orig_camera_input = st.camera_input _orig_sidebar_button = st.sidebar.button _orig_sidebar_checkbox = st.sidebar.checkbox @@ -62,6 +68,13 @@ def reset_counts(): _orig_sidebar_time_input = st.sidebar.time_input _orig_sidebar_file_uploader = st.sidebar.file_uploader _orig_sidebar_color_picker = st.sidebar.color_picker +# new elements, testing +_orig_sidebar_download_button = st.sidebar.download_button +_orig_sidebar_link_button = st.sidebar.link_button +_orig_sidebar_page_link = st.sidebar.page_link +_orig_sidebar_toggle = st.sidebar.toggle +_orig_sidebar_camera_input = st.sidebar.camera_input + def _track_user(): @@ -290,6 +303,12 @@ def start_tracking( st.time_input = _wrap_value(_orig_time_input) st.file_uploader = _wrap_file_uploader(_orig_file_uploader) st.color_picker = _wrap_value(_orig_color_picker) + # new elements, testing + st.download_button = _wrap_value(_orig_download_button) + st.link_button = _wrap_value(_orig_link_button) + st.page_link = _wrap_value(_orig_page_link) + st.toggle = _wrap_value(_orig_toggle) + st.camera_input = _wrap_value(_orig_camera_input) st.sidebar.button = _wrap_button(_orig_sidebar_button) st.sidebar.checkbox = _wrap_checkbox(_orig_sidebar_checkbox) @@ -305,6 +324,13 @@ def start_tracking( st.sidebar.time_input = _wrap_value(_orig_sidebar_time_input) st.sidebar.file_uploader = _wrap_file_uploader(_orig_sidebar_file_uploader) st.sidebar.color_picker = _wrap_value(_orig_sidebar_color_picker) + # new elements, testing + st.sidebar.download_button = _wrap_value(_orig_sidebar_download_button) + st.sidebar.link_button = _wrap_value(_orig_sidebar_link_button) + st.sidebar.page_link = _wrap_value(_orig_sidebar_page_link) + st.sidebar.toggle = _wrap_value(_orig_sidebar_toggle) + st.sidebar.camera_input = _wrap_value(_orig_sidebar_camera_input) + # replacements = { # "button": _wrap_bool, @@ -364,6 +390,12 @@ def stop_tracking( st.time_input = _orig_time_input st.file_uploader = _orig_file_uploader st.color_picker = _orig_color_picker + # new elements, testing + st.download_button = _orig_download_button + st.link_button = _orig_link_button + st.page_link = _orig_page_link + st.toggle = _orig_toggle + st.camera_input = _orig_camera_input st.sidebar.button = _orig_sidebar_button st.sidebar.checkbox = _orig_sidebar_checkbox @@ -379,6 +411,12 @@ def stop_tracking( st.sidebar.time_input = _orig_sidebar_time_input st.sidebar.file_uploader = _orig_sidebar_file_uploader st.sidebar.color_picker = _orig_sidebar_color_picker + # new elements, testing + st.sidebar.download_button = _orig_sidebar_download_button + st.sidebar.link_button = _orig_sidebar_link_button + st.sidebar.page_link = _orig_sidebar_page_link + st.sidebar.toggle = _orig_sidebar_toggle + st.sidebar.camera_input = _orig_sidebar_camera_input # Save count data to firestore. # TODO: Maybe don't save on every iteration but on regular intervals in a background From 5237ea7284bd37beb2a8626ed5ae63a3ba375322 Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Sun, 10 Mar 2024 11:32:59 +0200 Subject: [PATCH 3/7] added sourcing of local streamlit files + chat_input actually works (needs work tho) --- examples/minimal.py | 17 ++++++ src/streamlit_analytics2/main.py | 96 ++++++++++++++++++++++---------- tree | 28 ++++++++++ 3 files changed, 111 insertions(+), 30 deletions(-) create mode 100644 tree diff --git a/examples/minimal.py b/examples/minimal.py index d1e08cd..14f30d7 100644 --- a/examples/minimal.py +++ b/examples/minimal.py @@ -1,4 +1,16 @@ import platform +import sys +import os + +# Get the directory of the current script +current_script_path = os.path.dirname(os.path.abspath(__file__)) + +# Construct the path to the 'src' directory +src_directory_path = os.path.join(current_script_path, '..', 'src') + +# Add the 'src' directory to sys.path at the first position +sys.path.insert(0, src_directory_path) + import streamlit as st import streamlit_analytics2 as streamlit_analytics @@ -22,3 +34,8 @@ st.title("A [link]()") + + +prompt = st.chat_input("Say something") +if prompt: + st.write(f"User has sent the following prompt: {prompt}") diff --git a/src/streamlit_analytics2/main.py b/src/streamlit_analytics2/main.py index 76da754..e225900 100644 --- a/src/streamlit_analytics2/main.py +++ b/src/streamlit_analytics2/main.py @@ -48,11 +48,12 @@ def reset_counts(): _orig_file_uploader = st.file_uploader _orig_color_picker = st.color_picker # new elements, testing -_orig_download_button = st.download_button -_orig_link_button = st.link_button -_orig_page_link = st.page_link -_orig_toggle = st.toggle -_orig_camera_input = st.camera_input +# _orig_download_button = st.download_button +# _orig_link_button = st.link_button +# _orig_page_link = st.page_link +# _orig_toggle = st.toggle +# _orig_camera_input = st.camera_input +_orig_chat_input = st.chat_input _orig_sidebar_button = st.sidebar.button _orig_sidebar_checkbox = st.sidebar.checkbox @@ -69,11 +70,11 @@ def reset_counts(): _orig_sidebar_file_uploader = st.sidebar.file_uploader _orig_sidebar_color_picker = st.sidebar.color_picker # new elements, testing -_orig_sidebar_download_button = st.sidebar.download_button -_orig_sidebar_link_button = st.sidebar.link_button -_orig_sidebar_page_link = st.sidebar.page_link -_orig_sidebar_toggle = st.sidebar.toggle -_orig_sidebar_camera_input = st.sidebar.camera_input +# _orig_sidebar_download_button = st.sidebar.download_button +# _orig_sidebar_link_button = st.sidebar.link_button +# _orig_sidebar_page_link = st.sidebar.page_link +# _orig_sidebar_toggle = st.sidebar.toggle +# _orig_sidebar_camera_input = st.sidebar.camera_input @@ -238,6 +239,39 @@ def new_func(label, *args, **kwargs): return new_func +# Function to replace an empty placeholder +def replace_empty(placeholder): + return placeholder if placeholder else "Chat input" + +# Define the wrapper function +def _wrap_chat_input(func): + """ + Wrap st.chat_input to extend its functionality by directly tracking usage. + """ + + def new_func(placeholder="Your message", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None): + nonlocal func # Refer to the func parameter in the outer scope + placeholder = replace_empty(placeholder) # Ensure placeholder is not empty + + # Use a provided key or create one from the placeholder + unique_key = key if key is not None else placeholder + + # Increment the count for the chat_input widget directly + if unique_key not in st.session_state.widget_counts: + st.session_state.widget_counts[unique_key] = 0 + st.session_state.widget_counts[unique_key] += 1 + + # Call the original chat_input function + value = func(placeholder=placeholder, key=key, max_chars=max_chars, disabled=disabled, on_submit=on_submit, args=args, kwargs=kwargs) + + # Optionally, update session state with the last entered value + # This can be useful if you want to track the latest input across reruns + st.session_state[f"chat_input_value_{unique_key}"] = value + + # Return the value from the original chat_input + return value + + return new_func def start_tracking( verbose: bool = False, @@ -304,11 +338,12 @@ def start_tracking( st.file_uploader = _wrap_file_uploader(_orig_file_uploader) st.color_picker = _wrap_value(_orig_color_picker) # new elements, testing - st.download_button = _wrap_value(_orig_download_button) - st.link_button = _wrap_value(_orig_link_button) - st.page_link = _wrap_value(_orig_page_link) - st.toggle = _wrap_value(_orig_toggle) - st.camera_input = _wrap_value(_orig_camera_input) + # st.download_button = _wrap_value(_orig_download_button) + # st.link_button = _wrap_value(_orig_link_button) + # st.page_link = _wrap_value(_orig_page_link) + # st.toggle = _wrap_value(_orig_toggle) + # st.camera_input = _wrap_value(_orig_camera_input) + st.chat_input = _wrap_chat_input(_orig_chat_input) st.sidebar.button = _wrap_button(_orig_sidebar_button) st.sidebar.checkbox = _wrap_checkbox(_orig_sidebar_checkbox) @@ -325,11 +360,11 @@ def start_tracking( st.sidebar.file_uploader = _wrap_file_uploader(_orig_sidebar_file_uploader) st.sidebar.color_picker = _wrap_value(_orig_sidebar_color_picker) # new elements, testing - st.sidebar.download_button = _wrap_value(_orig_sidebar_download_button) - st.sidebar.link_button = _wrap_value(_orig_sidebar_link_button) - st.sidebar.page_link = _wrap_value(_orig_sidebar_page_link) - st.sidebar.toggle = _wrap_value(_orig_sidebar_toggle) - st.sidebar.camera_input = _wrap_value(_orig_sidebar_camera_input) + # st.sidebar.download_button = _wrap_value(_orig_sidebar_download_button) + # st.sidebar.link_button = _wrap_value(_orig_sidebar_link_button) + # st.sidebar.page_link = _wrap_value(_orig_sidebar_page_link) + # st.sidebar.toggle = _wrap_value(_orig_sidebar_toggle) + # st.sidebar.camera_input = _wrap_value(_orig_sidebar_camera_input) # replacements = { @@ -391,11 +426,12 @@ def stop_tracking( st.file_uploader = _orig_file_uploader st.color_picker = _orig_color_picker # new elements, testing - st.download_button = _orig_download_button - st.link_button = _orig_link_button - st.page_link = _orig_page_link - st.toggle = _orig_toggle - st.camera_input = _orig_camera_input + # st.download_button = _orig_download_button + # st.link_button = _orig_link_button + # st.page_link = _orig_page_link + # st.toggle = _orig_toggle + # st.camera_input = _orig_camera_input + st.chat_input = _orig_chat_input st.sidebar.button = _orig_sidebar_button st.sidebar.checkbox = _orig_sidebar_checkbox @@ -412,11 +448,11 @@ def stop_tracking( st.sidebar.file_uploader = _orig_sidebar_file_uploader st.sidebar.color_picker = _orig_sidebar_color_picker # new elements, testing - st.sidebar.download_button = _orig_sidebar_download_button - st.sidebar.link_button = _orig_sidebar_link_button - st.sidebar.page_link = _orig_sidebar_page_link - st.sidebar.toggle = _orig_sidebar_toggle - st.sidebar.camera_input = _orig_sidebar_camera_input + # st.sidebar.download_button = _orig_sidebar_download_button + # st.sidebar.link_button = _orig_sidebar_link_button + # st.sidebar.page_link = _orig_sidebar_page_link + # st.sidebar.toggle = _orig_sidebar_toggle + # st.sidebar.camera_input = _orig_sidebar_camera_input # Save count data to firestore. # TODO: Maybe don't save on every iteration but on regular intervals in a background diff --git a/tree b/tree new file mode 100644 index 0000000..db98aec --- /dev/null +++ b/tree @@ -0,0 +1,28 @@ +. +├── LICENSE +├── Pipfile +├── Pipfile.lock +├── examples +│   ├── minimal.py +│   ├── pages +│   │   ├── all-widgets.py +│   │   └── sharing-demo.py +│   └── requirements.txt +├── pyproject.toml +├── src +│   ├── streamlit_analytics2 +│   │   ├── __init__.py +│   │   ├── display.py +│   │   ├── firestore.py +│   │   ├── main.py +│   │   └── utils.py +│   └── streamlit_analytics2.egg-info +│   ├── PKG-INFO +│   ├── SOURCES.txt +│   ├── dependency_links.txt +│   ├── requires.txt +│   └── top_level.txt +├── tests +└── tree + +6 directories, 19 files From 05a67c5463fc4ca1f15f4d4d2174397837850051 Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Sun, 10 Mar 2024 12:44:12 +0200 Subject: [PATCH 4/7] added version printing to minimal.py --- examples/minimal.py | 4 ++-- src/streamlit_analytics2/__init__.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/minimal.py b/examples/minimal.py index 14f30d7..5ad78dc 100644 --- a/examples/minimal.py +++ b/examples/minimal.py @@ -17,13 +17,13 @@ # Get the software versions python_version = platform.python_version() streamlit_version = st.__version__ -# streamlit_analytics_version = streamlit_analytics.__version__ +streamlit_analytics_version = streamlit_analytics.__version__ # removing version printing since currently failing. Likely from beta release? # Print the versions st.write(f"Python version: {python_version}") st.write(f"Streamlit version: {streamlit_version}") -# st.write(f"streamlit_analytics version: {streamlit_analytics_version}") +st.write(f"streamlit_analytics version: {streamlit_analytics_version}") st.markdown("---") diff --git a/src/streamlit_analytics2/__init__.py b/src/streamlit_analytics2/__init__.py index 54da496..7307acc 100644 --- a/src/streamlit_analytics2/__init__.py +++ b/src/streamlit_analytics2/__init__.py @@ -1 +1,3 @@ from .main import counts, start_tracking, stop_tracking, track + +__version__ = "0.6.1" \ No newline at end of file From d3f46c48c95624a276e7b592e2a9161a485d60cf Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Sun, 10 Mar 2024 13:19:00 +0200 Subject: [PATCH 5/7] wrapper works, fixed incorrect import in other test files. updated dependencies --- Pipfile | 2 +- Pipfile.lock | 241 ++++++++++++--------------- examples/minimal.py | 13 +- examples/pages/all-widgets.py | 5 +- examples/pages/sharing-demo.py | 2 +- pyproject.toml | 4 +- src/streamlit_analytics2/__init__.py | 4 +- src/streamlit_analytics2/main.py | 37 ++-- tree | 28 ---- 9 files changed, 132 insertions(+), 204 deletions(-) delete mode 100644 tree diff --git a/Pipfile b/Pipfile index 7f9ba01..65e65be 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] -streamlit = ">=1.30" +streamlit = ">=1.31" altair = "*" pandas = "*" google-cloud-firestore = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 89d108c..28cfc92 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "f450880829f8fe69ddf408c44d6f8544a011c4bce3f248847da2613579046c67" + "sha256": "8ee7ab01382df20f3e35866516e170a79226fc0269381767229d6fecb04fcc29" }, "pipfile-spec": 6, "requires": { @@ -190,11 +190,11 @@ }, "google-auth": { "hashes": [ - "sha256:25141e2d7a14bfcba945f5e9827f98092716e99482562f15306e5b026e21aa72", - "sha256:34fc3046c257cedcf1622fc4b31fc2be7923d9b4d44973d481125ecc50d83885" + "sha256:80b8b4969aa9ed5938c7828308f20f035bc79f9d8fb8120bf9dc8db20b41ba30", + "sha256:9fd67bbcd40f16d9d42f950228e9cf02a2ded4ae49198b27432d0cded5a74c38" ], "markers": "python_version >= '3.7'", - "version": "==2.28.1" + "version": "==2.28.2" }, "google-cloud-core": { "hashes": [ @@ -223,69 +223,69 @@ }, "grpcio": { "hashes": [ - "sha256:0b9179478b09ee22f4a36b40ca87ad43376acdccc816ce7c2193a9061bf35701", - "sha256:0d3dee701e48ee76b7d6fbbba18ba8bc142e5b231ef7d3d97065204702224e0e", - "sha256:0d7ae7fc7dbbf2d78d6323641ded767d9ec6d121aaf931ec4a5c50797b886532", - "sha256:0e97f37a3b7c89f9125b92d22e9c8323f4e76e7993ba7049b9f4ccbe8bae958a", - "sha256:136ffd79791b1eddda8d827b607a6285474ff8a1a5735c4947b58c481e5e4271", - "sha256:1bc8449084fe395575ed24809752e1dc4592bb70900a03ca42bf236ed5bf008f", - "sha256:1eda79574aec8ec4d00768dcb07daba60ed08ef32583b62b90bbf274b3c279f7", - "sha256:29cb592c4ce64a023712875368bcae13938c7f03e99f080407e20ffe0a9aa33b", - "sha256:2c1488b31a521fbba50ae86423f5306668d6f3a46d124f7819c603979fc538c4", - "sha256:2e84bfb2a734e4a234b116be208d6f0214e68dcf7804306f97962f93c22a1839", - "sha256:2f3d9a4d0abb57e5f49ed5039d3ed375826c2635751ab89dcc25932ff683bbb6", - "sha256:36df33080cd7897623feff57831eb83c98b84640b016ce443305977fac7566fb", - "sha256:38f69de9c28c1e7a8fd24e4af4264726637b72f27c2099eaea6e513e7142b47e", - "sha256:39cd45bd82a2e510e591ca2ddbe22352e8413378852ae814549c162cf3992a93", - "sha256:3fa15850a6aba230eed06b236287c50d65a98f05054a0f01ccedf8e1cc89d57f", - "sha256:4cd356211579043fce9f52acc861e519316fff93980a212c8109cca8f47366b6", - "sha256:56ca7ba0b51ed0de1646f1735154143dcbdf9ec2dbe8cc6645def299bb527ca1", - "sha256:5e709f7c8028ce0443bddc290fb9c967c1e0e9159ef7a030e8c21cac1feabd35", - "sha256:614c3ed234208e76991992342bab725f379cc81c7dd5035ee1de2f7e3f7a9842", - "sha256:62aa1659d8b6aad7329ede5d5b077e3d71bf488d85795db517118c390358d5f6", - "sha256:62ccb92f594d3d9fcd00064b149a0187c246b11e46ff1b7935191f169227f04c", - "sha256:662d3df5314ecde3184cf87ddd2c3a66095b3acbb2d57a8cada571747af03873", - "sha256:748496af9238ac78dcd98cce65421f1adce28c3979393e3609683fcd7f3880d7", - "sha256:77d48e5b1f8f4204889f1acf30bb57c30378e17c8d20df5acbe8029e985f735c", - "sha256:7a195531828b46ea9c4623c47e1dc45650fc7206f8a71825898dd4c9004b0928", - "sha256:7e1f51e2a460b7394670fdb615e26d31d3260015154ea4f1501a45047abe06c9", - "sha256:7eea57444a354ee217fda23f4b479a4cdfea35fb918ca0d8a0e73c271e52c09c", - "sha256:7f9d6c3223914abb51ac564dc9c3782d23ca445d2864321b9059d62d47144021", - "sha256:81531632f93fece32b2762247c4c169021177e58e725494f9a746ca62c83acaa", - "sha256:81d444e5e182be4c7856cd33a610154fe9ea1726bd071d07e7ba13fafd202e38", - "sha256:821a44bd63d0f04e33cf4ddf33c14cae176346486b0df08b41a6132b976de5fc", - "sha256:88f41f33da3840b4a9bbec68079096d4caf629e2c6ed3a72112159d570d98ebe", - "sha256:8aab8f90b2a41208c0a071ec39a6e5dbba16fd827455aaa070fec241624ccef8", - "sha256:921148f57c2e4b076af59a815467d399b7447f6e0ee10ef6d2601eb1e9c7f402", - "sha256:92cdb616be44c8ac23a57cce0243af0137a10aa82234f23cd46e69e115071388", - "sha256:95370c71b8c9062f9ea033a0867c4c73d6f0ff35113ebd2618171ec1f1e903e0", - "sha256:98d8f4eb91f1ce0735bf0b67c3b2a4fea68b52b2fd13dc4318583181f9219b4b", - "sha256:a33f2bfd8a58a02aab93f94f6c61279be0f48f99fcca20ebaee67576cd57307b", - "sha256:ab140a3542bbcea37162bdfc12ce0d47a3cda3f2d91b752a124cc9fe6776a9e2", - "sha256:b3d3d755cfa331d6090e13aac276d4a3fb828bf935449dc16c3d554bf366136b", - "sha256:b71c65427bf0ec6a8b48c68c17356cb9fbfc96b1130d20a07cb462f4e4dcdcd5", - "sha256:b7a6be562dd18e5d5bec146ae9537f20ae1253beb971c0164f1e8a2f5a27e829", - "sha256:bcff647e7fe25495e7719f779cc219bbb90b9e79fbd1ce5bda6aae2567f469f2", - "sha256:c912688acc05e4ff012c8891803659d6a8a8b5106f0f66e0aed3fb7e77898fa6", - "sha256:ce1aafdf8d3f58cb67664f42a617af0e34555fe955450d42c19e4a6ad41c84bd", - "sha256:d6a56ba703be6b6267bf19423d888600c3f574ac7c2cc5e6220af90662a4d6b0", - "sha256:e803e9b58d8f9b4ff0ea991611a8d51b31c68d2e24572cd1fe85e99e8cc1b4f8", - "sha256:eef1d16ac26c5325e7d39f5452ea98d6988c700c427c52cbc7ce3201e6d93334", - "sha256:f359d635ee9428f0294bea062bb60c478a8ddc44b0b6f8e1f42997e5dc12e2ee", - "sha256:f4c04fe33039b35b97c02d2901a164bbbb2f21fb9c4e2a45a959f0b044c3512c", - "sha256:f897b16190b46bc4d4aaf0a32a4b819d559a37a756d7c6b571e9562c360eed72", - "sha256:fbe0c20ce9a1cff75cfb828b21f08d0a1ca527b67f2443174af6626798a754a4", - "sha256:fc2836cb829895ee190813446dce63df67e6ed7b9bf76060262c55fcd097d270", - "sha256:fcc98cff4084467839d0a20d16abc2a76005f3d1b38062464d088c07f500d170" - ], - "version": "==1.62.0" + "sha256:12859468e8918d3bd243d213cd6fd6ab07208195dc140763c00dfe901ce1e1b4", + "sha256:1714e7bc935780bc3de1b3fcbc7674209adf5208ff825799d579ffd6cd0bd505", + "sha256:179bee6f5ed7b5f618844f760b6acf7e910988de77a4f75b95bbfaa8106f3c1e", + "sha256:1f1e7b36bdff50103af95a80923bf1853f6823dd62f2d2a2524b66ed74103e49", + "sha256:1faa02530b6c7426404372515fe5ddf66e199c2ee613f88f025c6f3bd816450c", + "sha256:22bccdd7b23c420a27fd28540fb5dcbc97dc6be105f7698cb0e7d7a420d0e362", + "sha256:23e2e04b83f347d0aadde0c9b616f4726c3d76db04b438fd3904b289a725267f", + "sha256:3227c667dccbe38f2c4d943238b887bac588d97c104815aecc62d2fd976e014b", + "sha256:359f821d4578f80f41909b9ee9b76fb249a21035a061a327f91c953493782c31", + "sha256:3952b581eb121324853ce2b191dae08badb75cd493cb4e0243368aa9e61cfd41", + "sha256:407b26b7f7bbd4f4751dbc9767a1f0716f9fe72d3d7e96bb3ccfc4aace07c8de", + "sha256:4187201a53f8561c015bc745b81a1b2d278967b8de35f3399b84b0695e281d5f", + "sha256:482ae2ae78679ba9ed5752099b32e5fe580443b4f798e1b71df412abf43375db", + "sha256:48611e4fa010e823ba2de8fd3f77c1322dd60cb0d180dc6630a7e157b205f7ea", + "sha256:48f7135c3de2f298b833be8b4ae20cafe37091634e91f61f5a7eb3d61ec6f660", + "sha256:4b49fd8fe9f9ac23b78437da94c54aa7e9996fbb220bac024a67469ce5d0825f", + "sha256:58f6c693d446964e3292425e1d16e21a97a48ba9172f2d0df9d7b640acb99243", + "sha256:5bd90b8c395f39bc82a5fb32a0173e220e3f401ff697840f4003e15b96d1befc", + "sha256:60dcd824df166ba266ee0cfaf35a31406cd16ef602b49f5d4dfb21f014b0dedd", + "sha256:6696ffe440333a19d8d128e88d440f91fb92c75a80ce4b44d55800e656a3ef1d", + "sha256:6c455e008fa86d9e9a9d85bb76da4277c0d7d9668a3bfa70dbe86e9f3c759947", + "sha256:71f11fd63365ade276c9d4a7b7df5c136f9030e3457107e1791b3737a9b9ed6a", + "sha256:73db2dc1b201d20ab7083e7041946910bb991e7e9761a0394bbc3c2632326483", + "sha256:77c339403db5a20ef4fed02e4d1a9a3d9866bf9c0afc77a42234677313ea22f3", + "sha256:833379943d1728a005e44103f17ecd73d058d37d95783eb8f0b28ddc1f54d7b2", + "sha256:83a17b303425104d6329c10eb34bba186ffa67161e63fa6cdae7776ff76df73f", + "sha256:83e7ccb85a74beaeae2634f10eb858a0ed1a63081172649ff4261f929bacfd22", + "sha256:844d1f3fb11bd1ed362d3fdc495d0770cfab75761836193af166fee113421d66", + "sha256:882020c87999d54667a284c7ddf065b359bd00251fcd70279ac486776dbf84ec", + "sha256:8999bf1b57172dbc7c3e4bb3c732658e918f5c333b2942243f10d0d653953ba9", + "sha256:9084086190cc6d628f282e5615f987288b95457292e969b9205e45b442276407", + "sha256:960edebedc6b9ada1ef58e1c71156f28689978188cd8cff3b646b57288a927d9", + "sha256:973c49086cabab773525f6077f95e5a993bfc03ba8fc32e32f2c279497780585", + "sha256:978121758711916d34fe57c1f75b79cdfc73952f1481bb9583399331682d36f7", + "sha256:9bd5c8a1af40ec305d001c60236308a67e25419003e9bb3ebfab5695a8d0b369", + "sha256:a10383035e864f386fe096fed5c47d27a2bf7173c56a6e26cffaaa5a361addb1", + "sha256:a485f0c2010c696be269184bdb5ae72781344cb4e60db976c59d84dd6354fac9", + "sha256:a7f615270fe534548112a74e790cd9d4f5509d744dd718cd442bf016626c22e4", + "sha256:b134d5d71b4e0837fff574c00e49176051a1c532d26c052a1e43231f252d813b", + "sha256:b2a0e71b0a2158aa4bce48be9f8f9eb45cbd17c78c7443616d00abbe2a509f6d", + "sha256:b50b09b4dc01767163d67e1532f948264167cd27f49e9377e3556c3cba1268e1", + "sha256:b5a4ea906db7dec694098435d84bf2854fe158eb3cd51e1107e571246d4d1d70", + "sha256:b7209117bbeebdfa5d898205cc55153a51285757902dd73c47de498ad4d11332", + "sha256:bba97b8e8883a8038606480d6b6772289f4c907f6ba780fa1f7b7da7dfd76f06", + "sha256:be0477cb31da67846a33b1a75c611f88bfbcd427fe17701b6317aefceee1b96f", + "sha256:c7fcc6a32e7b7b58f5a7d27530669337a5d587d4066060bcb9dee7a8c833dfb7", + "sha256:c8842ccbd8c0e253c1f189088228f9b433f7a93b7196b9e5b6f87dba393f5d5d", + "sha256:d1f6c96573dc09d50dbcbd91dbf71d5cf97640c9427c32584010fbbd4c0e0037", + "sha256:d9e52558b8b8c2f4ac05ac86344a7417ccdd2b460a59616de49eb6933b07a0bd", + "sha256:e3393b0823f938253370ebef033c9fd23d27f3eae8eb9a8f6264900c7ea3fb5a", + "sha256:e6c8c8693df718c5ecbc7babb12c69a4e3677fd11de8886f05ab22d4e6b1c43b", + "sha256:f8de7c8cef9261a2d0a62edf2ccea3d741a523c6b8a6477a340a1f2e417658de", + "sha256:fa7d28eb4d50b7cbe75bb8b45ed0da9a1dc5b219a0af59449676a29c2eed9698", + "sha256:fbe80577c7880911d3ad65e5ecc997416c98f354efeba2f8d0f9112a67ed65a5" + ], + "version": "==1.62.1" }, "grpcio-status": { "hashes": [ - "sha256:0d693e9c09880daeaac060d0c3dba1ae470a43c99e5d20dfeafd62cf7e08a85d", - "sha256:3baac03fcd737310e67758c4082a188107f771d32855bce203331cd4c9aa687a" + "sha256:3431c8abbab0054912c41df5c72f03ddf3b7a67be8a287bb3c18a3456f96ff77", + "sha256:af0c3ab85da31669f21749e8d53d669c061ebc6ce5637be49a46edcb7aa8ab17" ], - "version": "==1.62.0" + "version": "==1.62.1" }, "idna": { "hashes": [ @@ -295,14 +295,6 @@ "markers": "python_version >= '3.5'", "version": "==3.6" }, - "importlib-metadata": { - "hashes": [ - "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e", - "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc" - ], - "markers": "python_version >= '3.8'", - "version": "==7.0.1" - }, "jinja2": { "hashes": [ "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa", @@ -448,7 +440,7 @@ "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3", "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f" ], - "markers": "python_version >= '3.9'", + "markers": "python_version < '3.11'", "version": "==1.26.4" }, "packaging": { @@ -596,45 +588,45 @@ }, "pyarrow": { "hashes": [ - "sha256:001fca027738c5f6be0b7a3159cc7ba16a5c52486db18160909a0831b063c4e4", - "sha256:003d680b5e422d0204e7287bb3fa775b332b3fce2996aa69e9adea23f5c8f970", - "sha256:036a7209c235588c2f07477fe75c07e6caced9b7b61bb897c8d4e52c4b5f9555", - "sha256:07eb7f07dc9ecbb8dace0f58f009d3a29ee58682fcdc91337dfeb51ea618a75b", - "sha256:0a524532fd6dd482edaa563b686d754c70417c2f72742a8c990b322d4c03a15d", - "sha256:0ca9cb0039923bec49b4fe23803807e4ef39576a2bec59c32b11296464623dc2", - "sha256:17d53a9d1b2b5bd7d5e4cd84d018e2a45bc9baaa68f7e6e3ebed45649900ba99", - "sha256:19a8918045993349b207de72d4576af0191beef03ea655d8bdb13762f0cd6eac", - "sha256:1f500956a49aadd907eaa21d4fff75f73954605eaa41f61cb94fb008cf2e00c6", - "sha256:2bd8a0e5296797faf9a3294e9fa2dc67aa7f10ae2207920dbebb785c77e9dbe5", - "sha256:47af7036f64fce990bb8a5948c04722e4e3ea3e13b1007ef52dfe0aa8f23cf7f", - "sha256:5b8d43e31ca16aa6e12402fcb1e14352d0d809de70edd185c7650fe80e0769e3", - "sha256:5db1769e5d0a77eb92344c7382d6543bea1164cca3704f84aa44e26c67e320fb", - "sha256:60a6bdb314affa9c2e0d5dddf3d9cbb9ef4a8dddaa68669975287d47ece67642", - "sha256:66958fd1771a4d4b754cd385835e66a3ef6b12611e001d4e5edfcef5f30391e2", - "sha256:6eda9e117f0402dfcd3cd6ec9bfee89ac5071c48fc83a84f3075b60efa96747f", - "sha256:6f87d9c4f09e049c2cade559643424da84c43a35068f2a1c4653dc5b1408a929", - "sha256:85239b9f93278e130d86c0e6bb455dcb66fc3fd891398b9d45ace8799a871a1e", - "sha256:876858f549d540898f927eba4ef77cd549ad8d24baa3207cf1b72e5788b50e83", - "sha256:8780b1a29d3c8b21ba6b191305a2a607de2e30dab399776ff0aa09131e266340", - "sha256:93768ccfff85cf044c418bfeeafce9a8bb0cee091bd8fd19011aff91e58de540", - "sha256:972a0141be402bb18e3201448c8ae62958c9c7923dfaa3b3d4530c835ac81aed", - "sha256:9950a9c9df24090d3d558b43b97753b8f5867fb8e521f29876aa021c52fda351", - "sha256:9a3a6180c0e8f2727e6f1b1c87c72d3254cac909e609f35f22532e4115461177", - "sha256:9ed5a78ed29d171d0acc26a305a4b7f83c122d54ff5270810ac23c75813585e4", - "sha256:c8c287d1d479de8269398b34282e206844abb3208224dbdd7166d580804674b7", - "sha256:d0ec076b32bacb6666e8813a22e6e5a7ef1314c8069d4ff345efa6246bc38593", - "sha256:d1c48648f64aec09accf44140dccb92f4f94394b8d79976c426a5b79b11d4fa7", - "sha256:d31c1d45060180131caf10f0f698e3a782db333a422038bf7fe01dace18b3a31", - "sha256:e2617e3bf9df2a00020dd1c1c6dce5cc343d979efe10bc401c0632b0eef6ef5b", - "sha256:e8ebed6053dbe76883a822d4e8da36860f479d55a762bd9e70d8494aed87113e", - "sha256:f01fc5cf49081426429127aa2d427d9d98e1cb94a32cb961d583a70b7c4504e6", - "sha256:f6ee87fd6892700960d90abb7b17a72a5abb3b64ee0fe8db6c782bcc2d0dc0b4", - "sha256:f75fce89dad10c95f4bf590b765e3ae98bcc5ba9f6ce75adb828a334e26a3d40", - "sha256:fa7cd198280dbd0c988df525e50e35b5d16873e2cdae2aaaa6363cdb64e3eec5", - "sha256:fe0ec198ccc680f6c92723fadcb97b74f07c45ff3fdec9dd765deb04955ccf19" + "sha256:07e652daac6d8b05280cd2af31c0fb61a4490ec6a53dc01588014d9fa3fdbee9", + "sha256:1519e218a6941fc074e4501088d891afcb2adf77c236e03c34babcf3d6a0d1c7", + "sha256:1b6e237dd7a08482a8b8f3f6512d258d2460f182931832a8c6ef3953203d31e1", + "sha256:21d812548d39d490e0c6928a7c663f37b96bf764034123d4b4ab4530ecc757a9", + "sha256:28cafa86e1944761970d3b3fc0411b14ff9b5c2b73cd22aaf470d7a3976335f5", + "sha256:2c1c3fc16bc74e33bf8f1e5a212938ed8d88e902f372c4dac6b5bad328567d2f", + "sha256:309e6191be385f2e220586bfdb643f9bb21d7e1bc6dd0a6963dc538e347b2431", + "sha256:31dc30c7ec8958da3a3d9f31d6c3630429b2091ede0ecd0d989fd6bec129f0e4", + "sha256:3a99eac76ae14096c209850935057b9e8ce97a78397c5cde8724674774f34e5d", + "sha256:3f111a014fb8ac2297b43a74bf4495cc479a332908f7ee49cb7cbd50714cb0c1", + "sha256:47b1eda15d3aa3f49a07b1808648e1397e5dc6a80a30bf87faa8e2d02dad7ac3", + "sha256:4f87757f02735a6bb4ad2e1b98279ac45d53b748d5baf52401516413007c6999", + "sha256:5186048493395220550bca7b524420471aac2d77af831f584ce132680f55c3df", + "sha256:738f6b53ab1c2f66b2bde8a1d77e186aeaab702d849e0dfa1158c9e2c030add3", + "sha256:7543ea88a0ff72f8e6baaf9bfdbec2c62aeabdbede9e4a571c71cc3bc43b6302", + "sha256:7bd167536ee23192760b8c731d39b7cfd37914c27fd4582335ffd08450ff799d", + "sha256:7c08bb31eb2984ba5c3747d375bb522e7e536b8b25b149c9cb5e1c49b0ccb736", + "sha256:83bc586903dbeb4365cbc72b602f99f70b96c5882e5dfac5278813c7d624ca3c", + "sha256:862eac5e5f3b6477f7a92b2f27e560e1f4e5e9edfca9ea9da8a7478bb4abd5ce", + "sha256:8f0ea3a29cd5cb99bf14c1c4533eceaa00ea8fb580950fb5a89a5c771a994a4e", + "sha256:9ad931b996f51c2f978ed517b55cb3c6078272fb4ec579e3da5a8c14873b698d", + "sha256:a476fefe8bdd56122fb0d4881b785413e025858803cc1302d0d788d3522b374d", + "sha256:a6d1f7c15d7f68f08490d0cb34611497c74285b8a6bbeab4ef3fc20117310983", + "sha256:abad2e08652df153a72177ce20c897d083b0c4ebeec051239e2654ddf4d3c996", + "sha256:b4157f307c202cbbdac147d9b07447a281fa8e63494f7fc85081da351ec6ace9", + "sha256:b75e7da26f383787f80ad76143b44844ffa28648fcc7099a83df1538c078d2f2", + "sha256:bb902f780cfd624b2e8fd8501fadab17618fdb548532620ef3d91312aaf0888a", + "sha256:be5c3d463e33d03eab496e1af7916b1d44001c08f0f458ad27dc16093a020638", + "sha256:c0f9c1d630ed2524bd1ddf28ec92780a7b599fd54704cd653519f7ff5aec177a", + "sha256:c2ddb3be5ea938c329a84171694fc230b241ce1b6b0ff1a0280509af51c375fa", + "sha256:cde663352bc83ad75ba7b3206e049ca1a69809223942362a8649e37bd22f9e3b", + "sha256:ce8c89848fd37e5313fc2ce601483038ee5566db96ba0808d5883b2e2e55dc53", + "sha256:dd532d3177e031e9b2d2df19fd003d0cc0520d1747659fcabbd4d9bb87de508c", + "sha256:e1fa92512128f6c1b8dde0468c1454dd70f3bff623970e370d52efd4d24fd0be", + "sha256:e524a31be7db22deebbbcf242b189063ab9a7652c62471d296b31bc6e3cae77b", + "sha256:efd3816c7fbfcbd406ac0f69873cebb052effd7cdc153ae5836d1b00845845d7" ], "markers": "python_version >= '3.8'", - "version": "==15.0.0" + "version": "==15.0.1" }, "pyasn1": { "hashes": [ @@ -838,16 +830,15 @@ }, "streamlit": { "hashes": [ - "sha256:a1a84249f7a9b854fe356db06c85dc03c3f9da4df06a33aa5a922647b955e8c8", - "sha256:dfc43ca85b4b4c31d097c27b983b8ccc960222ad907862b2b2fb4ddf04c50fdc" + "sha256:65bf22e190de973b910c0b127b33d80d31c5275ed891c6fde740de46e5e05323", + "sha256:d8458d6d00fd9d7e965e8125ec97d0ef7ed3d82844bf5663e71231fdb623ebb1" ], "index": "pypi", "markers": "python_version >= '3.8' and python_full_version != '3.9.7'", - "version": "==1.31.1" + "version": "==1.32.0" }, "streamlit-analytics2": { "editable": true, - "markers": "python_version >= '3.8'", "path": "." }, "tenacity": { @@ -907,14 +898,6 @@ "markers": "python_version >= '2'", "version": "==2024.1" }, - "tzlocal": { - "hashes": [ - "sha256:49816ef2fe65ea8ac19d19aa7a1ae0551c834303d5014c6d5a62e4cbda8047b8", - "sha256:8d399205578f1a9342816409cc1e46a93ebd5755e39ea2d85334bea911bf0e6e" - ], - "markers": "python_version >= '3.8'", - "version": "==5.2" - }, "urllib3": { "hashes": [ "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d", @@ -923,14 +906,6 @@ "markers": "python_version >= '3.8'", "version": "==2.2.1" }, - "validators": { - "hashes": [ - "sha256:61cf7d4a62bbae559f2e54aed3b000cea9ff3e2fdbe463f51179b92c58c9585a", - "sha256:77b2689b172eeeb600d9605ab86194641670cdb73b60afd577142a9397873370" - ], - "markers": "python_version >= '3.8'", - "version": "==0.22.0" - }, "watchdog": { "hashes": [ "sha256:11e12fafb13372e18ca1bbf12d50f593e7280646687463dd47730fd4f4d5d257", @@ -965,14 +940,6 @@ ], "markers": "platform_system != 'Darwin'", "version": "==4.0.0" - }, - "zipp": { - "hashes": [ - "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31", - "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0" - ], - "markers": "python_version >= '3.8'", - "version": "==3.17.0" } }, "develop": { diff --git a/examples/minimal.py b/examples/minimal.py index 5ad78dc..acb61a2 100644 --- a/examples/minimal.py +++ b/examples/minimal.py @@ -31,11 +31,8 @@ st.text_input("Write your name") st.selectbox("Select your favorite", ["cat", "dog", "flower"]) st.button("Click me") - - -st.title("A [link]()") - - -prompt = st.chat_input("Say something") -if prompt: - st.write(f"User has sent the following prompt: {prompt}") + prompt = st.chat_input("Send a prompt to the bot") + if prompt: + st.write(f"User has sent the following prompt: {prompt}") + + st.title("A [link]()") diff --git a/examples/pages/all-widgets.py b/examples/pages/all-widgets.py index e3dcaf1..b4f2fdd 100644 --- a/examples/pages/all-widgets.py +++ b/examples/pages/all-widgets.py @@ -1,5 +1,5 @@ import streamlit as st -import streamlit_analytics2 as streamlit +import streamlit_analytics2 as streamlit_analytics from datetime import datetime with streamlit_analytics.track(verbose=True): @@ -19,6 +19,9 @@ st.time_input("time_input") st.file_uploader("file_uploader") st.color_picker("color_picker") + prompt = st.chat_input("Send a prompt to the bot") + if prompt: + st.write(f"User has sent the following prompt: {prompt}") st.sidebar.checkbox("sidebar_checkbox") st.sidebar.button("sidebar_button") diff --git a/examples/pages/sharing-demo.py b/examples/pages/sharing-demo.py index a685c2c..4421a7c 100644 --- a/examples/pages/sharing-demo.py +++ b/examples/pages/sharing-demo.py @@ -3,7 +3,7 @@ import streamlit as st try: - import streamlit_analytics2 as streamlit + import streamlit_analytics2 as streamlit_analytics except ImportError: # Install streamlit-analytics on first run (not included in requirements.txt). import subprocess diff --git a/pyproject.toml b/pyproject.toml index c1eb287..af7a2d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "streamlit_analytics2" -version = "0.5.3" +version = "0.6.0" description = "Track & visualize user interactions with your streamlit app." authors = [{ name = "444B", email = "contact+pypi@444b.me" }] license = { file = "LICENSE" } @@ -26,7 +26,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "streamlit >= 1.30.0", + "streamlit >= 1.31.0", "pandas", "altair", "google-cloud-firestore" diff --git a/src/streamlit_analytics2/__init__.py b/src/streamlit_analytics2/__init__.py index 7307acc..0d1ac07 100644 --- a/src/streamlit_analytics2/__init__.py +++ b/src/streamlit_analytics2/__init__.py @@ -1,3 +1 @@ -from .main import counts, start_tracking, stop_tracking, track - -__version__ = "0.6.1" \ No newline at end of file +from .main import counts, start_tracking, stop_tracking, track \ No newline at end of file diff --git a/src/streamlit_analytics2/main.py b/src/streamlit_analytics2/main.py index e225900..4f28d4a 100644 --- a/src/streamlit_analytics2/main.py +++ b/src/streamlit_analytics2/main.py @@ -239,40 +239,31 @@ def new_func(label, *args, **kwargs): return new_func -# Function to replace an empty placeholder -def replace_empty(placeholder): - return placeholder if placeholder else "Chat input" - -# Define the wrapper function def _wrap_chat_input(func): """ - Wrap st.chat_input to extend its functionality by directly tracking usage. + Wrap a streamlit function that returns a single value (str/int/float/datetime/...), + e.g. st.slider, st.text_input, st.number_input, st.text_area, st.date_input, + st.time_input, st.color_picker. """ - def new_func(placeholder="Your message", *, key=None, max_chars=None, disabled=False, on_submit=None, args=None, kwargs=None): - nonlocal func # Refer to the func parameter in the outer scope - placeholder = replace_empty(placeholder) # Ensure placeholder is not empty - - # Use a provided key or create one from the placeholder - unique_key = key if key is not None else placeholder - - # Increment the count for the chat_input widget directly - if unique_key not in st.session_state.widget_counts: - st.session_state.widget_counts[unique_key] = 0 - st.session_state.widget_counts[unique_key] += 1 + def new_func(placeholder, *args, **kwargs): + value = func(placeholder, *args, **kwargs) + if placeholder not in counts["widgets"]: + counts["widgets"][placeholder] = {} - # Call the original chat_input function - value = func(placeholder=placeholder, key=key, max_chars=max_chars, disabled=disabled, on_submit=on_submit, args=args, kwargs=kwargs) + formatted_value = str(value) - # Optionally, update session state with the last entered value - # This can be useful if you want to track the latest input across reruns - st.session_state[f"chat_input_value_{unique_key}"] = value + if formatted_value not in counts["widgets"][placeholder]: + counts["widgets"][placeholder][formatted_value] = 0 - # Return the value from the original chat_input + if formatted_value != st.session_state.state_dict.get(placeholder): + counts["widgets"][placeholder][formatted_value] += 1 + st.session_state.state_dict[placeholder] = formatted_value return value return new_func + def start_tracking( verbose: bool = False, firestore_key_file: str = None, diff --git a/tree b/tree deleted file mode 100644 index db98aec..0000000 --- a/tree +++ /dev/null @@ -1,28 +0,0 @@ -. -├── LICENSE -├── Pipfile -├── Pipfile.lock -├── examples -│   ├── minimal.py -│   ├── pages -│   │   ├── all-widgets.py -│   │   └── sharing-demo.py -│   └── requirements.txt -├── pyproject.toml -├── src -│   ├── streamlit_analytics2 -│   │   ├── __init__.py -│   │   ├── display.py -│   │   ├── firestore.py -│   │   ├── main.py -│   │   └── utils.py -│   └── streamlit_analytics2.egg-info -│   ├── PKG-INFO -│   ├── SOURCES.txt -│   ├── dependency_links.txt -│   ├── requires.txt -│   └── top_level.txt -├── tests -└── tree - -6 directories, 19 files From 2a550ce9bc6b6c1579e81d3d9d5cf1b8a2423ad4 Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Sun, 10 Mar 2024 13:27:30 +0200 Subject: [PATCH 6/7] removed version numbering. passed tests --- examples/minimal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/minimal.py b/examples/minimal.py index acb61a2..4aa138f 100644 --- a/examples/minimal.py +++ b/examples/minimal.py @@ -17,13 +17,13 @@ # Get the software versions python_version = platform.python_version() streamlit_version = st.__version__ -streamlit_analytics_version = streamlit_analytics.__version__ +# streamlit_analytics_version = streamlit_analytics.__version__ # removing version printing since currently failing. Likely from beta release? # Print the versions st.write(f"Python version: {python_version}") st.write(f"Streamlit version: {streamlit_version}") -st.write(f"streamlit_analytics version: {streamlit_analytics_version}") +# st.write(f"streamlit_analytics version: {streamlit_analytics_version}") st.markdown("---") From 73cd3b87f2db02e7653fbb737058b17e99c824f7 Mon Sep 17 00:00:00 2001 From: 444B <15311579+444B@users.noreply.github.com> Date: Sun, 10 Mar 2024 13:31:29 +0200 Subject: [PATCH 7/7] bump version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index af7a2d4..7b5928e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "streamlit_analytics2" -version = "0.6.0" +version = "0.6.1" description = "Track & visualize user interactions with your streamlit app." authors = [{ name = "444B", email = "contact+pypi@444b.me" }] license = { file = "LICENSE" }