Skip to main content

Track & visualize user interactions with your streamlit app.

Project description

streamlit-analytics2  👀

PyPi

Enhanced tracking & visualization for your Streamlit apps.

streamlit-analytics2 is a fork and extension of the original streamlit-analytics, aimed at improving and securing the analytics functionality within Streamlit applications. With minimal setup, track user interactions and visualize analytics directly in your browser, akin to Google Analytics but tailored for Streamlit.

This fork was initiated due to the inability to collaborate directly on the upstream project, which currently has several unresolved security issues and bugs. Our intention is to maintain a positive relationship with the original project and its creator, focusing on enhancing the tool's reliability and security for the community.

[!Note] This fork is confirmed to fix the deprecation st.experimental_get_query_params alerts. Context
It also resolved 25 security issues that exist in the upstream (2 Critical, 11 High, 10 Moderate, 2 Low)

This project is in active development. We welcome contributions and address security concerns on a best-effort basis, with details available in our CONTRIBUTING.md and SECURITY.md respectively.

Installation

pip install streamlit-analytics2

Migration from upstream streamlit-analytics

Only two single characters need to be changed and this has been tested and verified to work.

  1. Change your requirements.txt or other dependency file to use 'streamlit-analytics2'. Just add a '2'
  2. Change your code import to use 'streamlit_analytics2 as streamlit_analytics'. Also, just add a '2'. Seen below.

[!IMPORTANT] This project aims to be backwards compatible with the upstream and migration literally just means adding the number 2 and getting the new package.
The above steps should be sufficient but if you need more steps, check out our Migration Guide.

How to Use

Simple integration with any Streamlit app:

import streamlit as st
import streamlit_analytics2 as streamlit_analytics

with streamlit_analytics.track():
    st.write("Hello, World!")
    st.button("Click me")

All interactions are now tracked, supporting all standard Streamlit widgets.

Another way to get the tracking is to call the streamlit_analytics.track() on your main() function:

import streamlit as st
import streamlit_analytics2 as streamlit_analytics

with streamlit_analytics.track():
    main()

def main():
    st.write("Hello, World!")
    st.button("Click me")

Using streamlit_analytics.track() is the recommended method and will become the primary way to initiate streamlit-analytics2 after the upcoming v.1.0.0 release.

Moving Forward

  • TODOs and Feature Requests: We've transitioned our roadmap and feature requests to GitHub Issues. Feel free to contribute ideas or report bugs!
  • Advanced Configuration: Detailed guidance on advanced setup (including password protection and database integration) options are available in our Project Wiki.
  • Improved Performance: We are focused on providing a use of streamlit-analytics2 that doesn't impact the performance of your app.
    All suggestions and inputs are welcome on our forum

Contributing

Your contributions are welcome! Please refer to our CONTRIBUTING.md for guidelines on how to make a difference. The step by step guide will show you how to set up a dev environment, testing standards and how to make a PR.

Security

We prioritize the security of our users' data. For reporting security vulnerabilities or for more information, please review our SECURITY.md.

Acknowledgments

A special thanks to jrieke and all contributors to the original streamlit-analytics project. Your work has inspired continued innovation and community collaboration.

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_analytics2-0.6.4.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_analytics2-0.6.4-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_analytics2-0.6.4.tar.gz.

File metadata

  • Download URL: streamlit_analytics2-0.6.4.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for streamlit_analytics2-0.6.4.tar.gz
Algorithm Hash digest
SHA256 a550d0f54d3c8428c7fd26f39d08a1a864472e5821161f044870b0dc24edc54a
MD5 bd8dbcbe5d1726d056328f61d482164e
BLAKE2b-256 41f34186ef3719d63eef99bc998f0b618afe5b849e46b964368a2a3f58a48aaa

See more details on using hashes here.

File details

Details for the file streamlit_analytics2-0.6.4-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_analytics2-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 38b4029107599147807b48f7dcef3532e35c15e9c21b970ddcba5e363af0c8a7
MD5 16625428a3aa29b7306e9d67e66c8aa7
BLAKE2b-256 44ba31333623fc85a0ac3a065f111863a3f56989064166c7993521374e21356d

See more details on using hashes here.

Supported by

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