Hi all,
I am new to Streamlit. I am a data analyst and use Python frequently I have an idea to aggregate agricultural data from various public resources and show it in graphs etc with a small description on a public website. I already have a sponsor who will pay for their logo on the public website. I looked into Django but I do not have experience with html/CSS/JS. I saw that Streamlit would be perfect for this but I do not know if Streamlit works as a public website with for example 500 visitors per week. I do not need login authentication or anything, I just want to show interactive data visualisations which are based on my database which is updated every day (I already have a python script which fetches data and puts it in a database).
Is Streamlit a good idea for the idea above? And if so; what do I have to keep in mind? / how te get started?
Streamlit would work great for your project. You can build your app and deploy it to Streamlit Community Cloud. As for refreshing your app everyday to match the data in your DB, you can use the recently released st.fragment to set the interval to auto-rerun your app.
Here’s a rough example to get you started:
import streamlit as st
from datetime import datetime, timedelta
def fetch_data():
# fetch data from your db
# Define a fragment that fetches and displays data
@st.experimental_fragment(run_every=timedelta(days=1)) # Run the fragment daily
def update_data_fragment():
# Fetch data from the database
data = fetch_data()
# Visualize the data
st.dataframe(data)
# Call the fragment function to display the data
update_data_fragment()
Hi @tonykip,
Thanks a lot for your answer. Is it possible as well to deploy it using an available domain of my choosing? For example: myagriculturaldataagrigator.com? Or isn’t this possible with Streamlit.
Also: how do I make sure that my update_data_frament() function can run without my machine being on?
Streamlit offers custom domains that end with .streamlit.app. For other domain endings, you would need to get those separately through a domain service.
To rerun your st.experimental_fragment you can use the rerun_every parameter to set the time to rerun like in the image below.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.