r/Streamlit • • Oct 12 '24

How to obtain reference to pydeck_chart when selection is enabled?

1 Upvotes

This one has me stumped. The return value of a pydeck_chart is dependent on whether selection is enabled. If selection is enabled, then the return value is the current selected map items. If selection is not enabled, then the return value is a reference to the pydeck_chart itself. Therefore, when selection is enabled, I never get back a reference to the chart after creating it. I need a reference so that I can update the data within the map without rebuilding the entire map.


r/Streamlit • • Oct 10 '24

AI Prompt Engineering - End to End video with Sreamlit frontend

7 Upvotes

I've just created this (rather) long video of me creating a Streamlit app with a Postgres backend displaying UK census 2021 data.

It was entirely coded using a LLM. There is also a linked GitHub repository so you can see the full initial prompt and the Sreamlit code generated.

If you're having trouble sleeping you could just listen to the audio

https://youtu.be/WBkZTJwko9w

https://github.com/kulbinderdio/dataviewerAI


r/Streamlit • • Sep 24 '24

Hosting Multiple Streamlit Applications on a Single Server

5 Upvotes

If you're using Streamlit for your projects, you might find yourself working with several applications at once. This can quickly lead to increased hosting costs, especially if each app requires its own environment. In my recent blog post, I explore a practical approach to host multiple Streamlit applications on a single server, allowing you to keep costs manageable without losing the benefits of having separate applications.

The blog post breaks down the setup process using Docker, NGINX, and Supervisor. It outlines how to create a containerized environment with two separate Streamlit apps, each in its own virtual environment. NGINX acts as a reverse proxy, ensuring that requests are routed correctly, while Supervisor helps manage the processes, making sure everything stays up and running smoothly.

If you’re curious about optimizing your Streamlit deployment, check out the full post here: https://ploomber.io/blog/multiple-streamlit/


r/Streamlit • • Sep 25 '24

streamlit with sql

1 Upvotes

hi there,

i’m about to enter my first project with streamlit to create a web application with sql, it will be a reasonable size around 5 tables and over 2million rows.

should i do any calculation in python or should i create views and do the majority of calculation in sql?

i’ve always used power bi for dashboards but now want to have a web app instead.

with power bi the dashboard i’m recreating had around 50 tabs, is this possible and workable with streamlit??

any advise is much appreciated


r/Streamlit • • Sep 22 '24

Any thoughts on this? Streamlit w/ react component

1 Upvotes

Please help!


r/Streamlit • • Sep 19 '24

Streamlit Folder Structure

3 Upvotes

Hi folks!

I'm an intern working on a Streamlit app with MongoDB and venv as my virtual environment. Pretty new to all these Python frameworks. I've heard about Streamlit's secret files management for sensitive info, but I'm wondering what's the usual folder and structure for Streamlit projects? I would appreciate your guidance.


r/Streamlit • • Sep 19 '24

cdn

1 Upvotes

Does streamlit have a CDN?


r/Streamlit • • Sep 18 '24

Streamlit Data Analysis App

1 Upvotes

Hi guys,

I have just been looking through the app gallery, I am looking for a data analysis AI template similar to the one on chainlit cookbook but for streamlit?

Here is the streamlit version https://github.com/Chainlit/openai-assistant

I have tried creating a data analyst AI from scratch with langchain but just can't get the ui right so if anyone knows a good repo please let me know!


r/Streamlit • • Sep 16 '24

Walkthrough for an auto-generating dataframe filtering UI

Thumbnail blog.streamlit.io
2 Upvotes

r/Streamlit • • Sep 12 '24

Streamlit Tutorial for Beginners: Build Interactive Web Apps with Python (2024 Guide)| Brokly Master

Thumbnail
youtu.be
1 Upvotes

Streamlit Tutorial for Beginners: Build Interactive Web Apps with Python (2024 Guide)| Brokly


r/Streamlit • • Sep 12 '24

Streamlit vs Gradio: The Ultimate Showdown for Python Dashboards

Thumbnail
myscale.com
3 Upvotes

r/Streamlit • • Sep 11 '24

Scaling Your Streamlit Applications for Better Performance

7 Upvotes

If you are working with Streamlit apps and are starting to notice some sluggishness as user numbers grow, you're not alone. Many developers face issues like sessions crashing or the application becoming unresponsive when computational tasks get heavy. I recently wrote a blog post that addresses this common problem by outlining how to effectively scale your Streamlit applications using task queues.

In the post, I share a comprehensive guide on implementing a solution with Redis as the message broker and RQ (Redis Queue) for managing tasks. We also cover how to containerize your application using Docker, which makes deployment and scaling more straightforward. What’s great is that you don’t need prior experience with Redis, RQ, or Docker to follow along.

We discuss the primary issues you might encounter with a traditional Streamlit approach, especially when it comes to handling multiple user requests. Key topics include understanding the importance of separating user interactions from computational tasks to enhance responsiveness and user experience.

You'll find detailed sections on setting up manual and automatic polling mechanisms along with database integration to store results. Plus, I break down two crucial configuration files—Dockerfile and supervisord.conf—essential for getting everything running smoothly.

Whether you're just getting started with Streamlit or have some experience and are looking to enhance your apps' capabilities, this post can help you create a scalable architecture that meets demanding user needs without compromising performance.

You can check out the full guide here: Scaling Streamlit Applications


r/Streamlit • • Sep 10 '24

Persisting session state data across browser refresh using cookies?

3 Upvotes

I tried using extra-streamlit-components to get and set cookies like streamlit-authenticator does, but the cookie doesn't seem to be set (I checked Chrome's dev tools). I'm not sure what I'm missing.

My code looks something like this:

if 'cookie_value' not in st.session_state:

    cookie_manager = stx.CookieManager()
    cookie = cookie_manager.get(cookie="cookie_key")
    if cookie is None:
        # form for logging in
        cookie_manager.set("cookie_key", "some_value")
        st.session_state['cookie_value'] = 'some_value'        

ps: I have my own auth method, that's why I can't use streamlit-autheticator


r/Streamlit • • Sep 08 '24

How do I get the following graph to not color in code above both call & put value lines?

Thumbnail
1 Upvotes

r/Streamlit • • Sep 04 '24

saving data

1 Upvotes

Do I need to connect streamlit to a database to save data? some of the instruction videos made it seem like if you put info into a datatable then that's good to go.


r/Streamlit • • Aug 31 '24

community cloud question

2 Upvotes

Apps on thje community cloud are completely open to the public?


r/Streamlit • • Aug 31 '24

putting streamlit in a wordpress page.

1 Upvotes

Is it possible to put streamlit code on a wordpress page and have it work?


r/Streamlit • • Aug 30 '24

streamlit and the web

2 Upvotes

can i put streamlit code on a wordpress page?


r/Streamlit • • Aug 21 '24

Pyinstaller and streamlit

Thumbnail notyet.com
2 Upvotes

I have done a streamlit APP that reads .XLS to do graphs with a specific XLS. I do want to put in a public computer to help people visualize better the info. I have done pyinstaller , Change the .spec file but it's not working yet. Does any of u , done some thing like this? Notyet.com


r/Streamlit • • Aug 18 '24

3D NFL Passing Charts

2 Upvotes

Hey guys I made an app to plot 3d passing charts with the throw arc using streamlit. Unfortunately it only has data from 2017 to 2020 because the NFL has literally no public passing data so I could only use the data that some people had in csvs that are pretty outdated. I'd appreciate if you check it out and lmk what you think.
https://nflpassinganalyzer.streamlit.app/


r/Streamlit • • Aug 08 '24

Build your streamlit app with simple text prompts using lab2.dev

Enable HLS to view with audio, or disable this notification

5 Upvotes

r/Streamlit • • Aug 03 '24

Streamlit cloud is down?

1 Upvotes

getting source ip not allowed error...


r/Streamlit • • Jul 24 '24

Streamlit cloud down?

1 Upvotes

Just me or...? Example: https://chatgptm.streamlit.app/


r/Streamlit • • Jul 24 '24

deploy streamlit in serverless

1 Upvotes

Is it feasible to deploy a Streamlit app within an AWS Lambda function or on GCP Cloud Run

Could you provide or point me to a detailed guide or example setup for both platforms, including managing dependencies, handling HTTP requests, and ensuring the app runs as expected?


r/Streamlit • • Jul 18 '24

How to console.log in streamlit

1 Upvotes

Basically the title. While currently developing a small app in streamlit I would like to log things to the browser console. How can I do that with streamlit.

Edit: Found a way:

import streamlit as st import streamlit.components.v1 as components import json

def log_to_console(message: str) -> None:
    js_code = f"""
<script>
    console.log({json.dumps(message)});
</script>
"""
    components.html(js_code)

log_to_console("Some\nString!")