Data apps are simple, interactive web applications that use data to deliver insights or automatically take action. They are usually custom-tailored to tackle a specific problem and enable a dynamic, purpose-built user experience.
Examples of data apps include recommendation engines, interactive segmentation, AI integration, data visualization, customized internal reporting tools for business teams, and financial apps for analyzing spending patterns.
Data apps may be written in any language. However, for now Keboola only supports apps written in Streamlit, a Python framework for the rapid development of such applications.
As mentioned above, a data app is a simple web application, which can be deployed inside a Keboola project and also publicly accessed from outside the project. This means that users accessing your data app do not need access to a Keboola project.
First, enter a custom prefix for your data app, which you will share with your users later.
There are two ways to create a data app in Keboola. Select a deployment type that will suit your needs:
For simple use cases where your Streamlit code fits on one page, paste the code directly into a text area. This deployment type is ideal for simple apps or for testing. Check out our Titanic Demo App or this example from Streamlit docs.
To use additional Python packages that are not already included in our Streamlit Base Image, enter them into the Packages
field.
Currently in beta, we only support GitHub repositories.
To provide feedback, use the feedback button in your project. If you have a complex application, push your app sources into GitHub and link the repository in this section. Provide the Project URL, choose the right branch, and finally, select your main entrypoint file.
If you are using a private repository, you have two options to authenticate:
Follow these steps to authenticate using your GitHub username and personal access token:
Generate a personal access token on GitHub by going to your GitHub account settings, selecting Developer settings > Personal access tokens, and clicking Generate new token. Ensure the token has the necessare permissions to access the repository.
In Keboola, navigate to the Data App Repository in your data app configuration, check the Private
option, and enter your GitHub username and the personal access token you generated in step 1.
Click Save to authenticate with the private repository.
To authenticate using your SSH private key, follow the instructions in the GitHub manual. After generating your key, enter your SSH private key into the appropriate configuration field and click Save.
Now, you can deploy your data app from the private repository and access it within your Keboola project.
To provide your app with environment variables or sensitive information like credentials, API keys, etc., enter them as key value pairs in the section Secrets.
These secrets will be injected into the secrets.toml
file upon deployment of the app.
Read more about the Streamlit secrets.
By default, there are two environment variables available that make it easy to access Keboola storage from your application:
KBC_URL
: This represents the URL of the current Keboola project.KBC_TOKEN
: This represents the storage token with full read-write access to Keboola Storage.These environment variables can be accessed within your Streamlit data app code. Here is an example of how to initialize the Keboola storage token:
# Constants
kbc_token = os.environ.get('KBC_TOKEN')
kbc_url = os.environ.get('KBC_URL')
# Initialize Client
client = Client(kbc_url, kbc_token)
These variables represent the project where the application is deployed. To map data from a different project, you need to configure the appropriate secrets.
To load data from the storage of a Keboola project into the app, use the input mapping section.
Just select your table in the input mapping section and navigate to that by /data/in/tables/your_data.csv
or /data/in/files/fileID_FileName.*
in your code.
Note that, while in BETA, the app needs to be redeployed to fetch up-to-date data.
Or you can use the Keboola Storage Python Client in the app to load the data as needed.
See the examples below for usage of the Keboola Storage Python Client.
For writing data back to Keboola Project Storage, use our Keboola Storage Python Client. See the examples below for usage of the Keboola Storage Python Client.
Once the data app is deployed, its URL will be publicly available! Keboola provides two authorization methods.
We recommend using the authorization methods provided by Keboola. Select the method that best suits your app’s requirements and security needs.
This method allows you to authenticate a user using a password generated by Keboola.
This enables users to log into your app using your Single Sign-On (SSO) providers.
If you enter an app with OIDC, you’ll be asked to select an Authentication Provider
and sign in.
Alternatively, you may implement your own authorization method within your Streamlit data app. For instance, you can use the Streamlit authenticator. For guidance, check out the Streamlit authenticator tutorial or take a look at our example.
To configure theming in your data app, you can select from predefined themes or create a custom theme. Predefined themes include Keboola
, Light Red
, Light Purple
, Light Blue
, Dark Green
, Dark Amber
, and Dark Orange
. Each theme has a specified primary color, background color, secondary background color, text color, and font. Users choosing Custom
can manually set these values.
For Custom
, users can select colors using the color pickers and choose the desired font from a list.
#1F8FFF
#FFFFFF
#E6F2FF
#222529
#FF5D5D
#FFFFFF
#FFE6E6
#222529
#9A6DD7
#FFFFFF
#F2E6FF
#222529
#0000B2
#FFFFFF
#E6E6FF
#222529
#4CAF50
#222529
#3D4F41
#FFFFFF
#FFC107
#222529
#4A3A24
#FFFFFF
#FFA500
#222529
#4A3324
#FFFFFF
Our Suspend/Resume feature helps you save resources by automatically putting your app to sleep after an hour of inactivity. Here’s how it works:
Activity Monitoring: The app monitors for HTTP requests. If no activity is detected for one hour, the app automatically suspends.
Automatic Resumption: As soon as a new request is made to the app, it wakes up and resumes operation. While the resume process is designed to be smooth, the first request upon waking may take slightly longer to process.
Cost Efficiency: For example, if your app is active for two hours and then becomes inactive, it will go to sleep after one additional hour of inactivity. You’ll only be billed for the three hours when the app was active or waiting to suspend.
This feature is not only efficient but also intelligent—ensuring you pay only for what you use, while keeping the app ready for when you need it next.
If you enter the URL of a sleeping app, it will trigger its wakeup, and you’ll see a waking up page.
Should anything unexpected occur, a wakeup error page will appear, and you can click Show More to view the error details.
When you click Deploy or Redeploy for your app, a wizard will appear, prompting you to specify the backend size and the auto-sleep timeout. You can set the duration of inactivity after which the app will go to sleep, with options ranging from five minutes to 24 hours. The default is set to five minutes.
When the app is deployed, the code specified in one of the deployment methods will be injected into our base Streamlit Docker image. This image already has Streamlit and a few other basic packages pre-installed:
# Dockerfile
FROM python:3.8-slim
RUN groupadd --gid 1000 appuser \
&& useradd --uid 1000 --gid 1000 -ms /bin/bash appuser
RUN pip3 install --no-cache-dir --upgrade \
pip \
virtualenv
RUN apt-get update && apt-get install -y \
build-essential \
software-properties-common \
git \
jq \
vim
RUN mkdir -m 777 /data
USER appuser
WORKDIR /home/appuser
ENV VIRTUAL_ENV=/home/appuser/venv
RUN virtualenv ${VIRTUAL_ENV}
ENV STREAMLIT_SERVER_PORT=8888
EXPOSE 8888
COPY run.sh /home/appuser
ENTRYPOINT ["./run.sh"]
# pip list
Package Version
------------------------- -----------
altair 5.0.1
attrs 23.1.0
backports.zoneinfo 0.2.1
blinker 1.6.2
cachetools 5.3.1
certifi 2023.7.22
charset-normalizer 3.2.0
click 8.1.6
decorator 5.1.1
gitdb 4.0.10
GitPython 3.1.32
idna 3.4
importlib-metadata 6.8.0
importlib-resources 6.0.0
Jinja2 3.1.2
jsonschema 4.18.4
jsonschema-specifications 2023.7.1
markdown-it-py 3.0.0
MarkupSafe 2.1.3
mdurl 0.1.2
numpy 1.24.4
packaging 23.1
pandas 2.0.3
Pillow 9.5.0
pip 23.1.2
pkgutil_resolve_name 1.3.10
protobuf 4.23.4
pyarrow 12.0.1
pydeck 0.8.0
Pygments 2.15.1
Pympler 1.0.1
python-dateutil 2.8.2
pytz 2023.3
pytz-deprecation-shim 0.1.0.post0
referencing 0.30.0
requests 2.31.0
rich 13.4.2
rpds-py 0.9.2
setuptools 67.7.2
six 1.16.0
smmap 5.0.0
streamlit 1.25.0
tenacity 8.2.2
toml 0.10.2
toolz 0.12.0
tornado 6.3.2
typing_extensions 4.7.1
tzdata 2023.3
tzlocal 4.3.1
urllib3 2.0.4
validators 0.20.0
watchdog 3.0.0
wheel 0.40.0
zipp 3.16.2
Please note that the versions of these packages may change, as the newest version of the Streamlit package is used upon deployment unless explicitly specified in the Packages
field.
If the data app’s deployment job fails, you can see the logs from its container in the event log of the deployment job.
For example, there may be a conflict with the specified packages:
Author: Jordan Burger
This demo data app shows how to create a data app with Streamlit Python code from a code directly in Keboola.
Author: Monika Feigler
This demo data app shows how to create a data app with Streamlit Python code and how to incorporate data and files from an input mapping into your code. This data app allows users to explore and analyze the Titanic dataset using interactive visualizations and filters.
Author: Petr Huňka
This demo app offers a cutting-edge solution that leverages Shopify data to supercharge your campaigns. By harnessing the power of artificial intelligence (AI), tailor-made SMS messages are created and delivered through Twilio’s platform. The result? A seamlessly personalized approach that captivates your audience, ensuring your marketing efforts are not only effective but also driven by AI precision.
The complete workflow for this data app can be implemented using the AI SMS Campaign template.
Author: Petr Huňka
Simplify data editing and management within your company. The data app eliminates the need to export data to external tools, allowing business users to directly access and edit tables stored in Keboola Storage.
This data app, along with the complete workflow, can be implemented using the Interactive Keboola Sheets template.
Author: Ondřej Svoboda
This data app provides an interactive display of several business metrics with integrated Slack notifications.
This app, along with the complete workflow, can be implemented using the eCommerce KPI Dashboard template.
Author: Monika Feigler
This demo app provides an overview of the costs for all campaigns across marketing channels.
This data app, along with the complete workflow, can be implemented using the Advertising Platform template.
Author: Marketing BI and Keboola
This data app is designed to provide a quick and comprehensive overview of the differences between data gathered by Google’s Universal Analytics (UA) and Google Analytics 4 (GA4).
This app, along with the complete workflow, can be implemented using the UA and GA4 Comparison template.
Author: Jordan Burger and Pavel Chocholouš
The SQL Bot data app is a dialogue-based AI interface tailored for Snowflake database queries. It allows you to engage in natural conversations and translates your requests into precise SQL commands.
This app, along with the complete workflow, can be implemented using the Kai SQL Bot template.