Before you start
To develop Streamlit apps in CDF, we recommend that you get familiar with Python programming, the Streamlit library, and the Cognite Python SDK. Also, make sure that you have the necessary access capabilities.Create an app
1
Navigate to Streamlit apps
Navigate to Data management > Build solutions > Streamlit apps.
2
Create a new app
Select Create app and start from scratch, import a Streamlit application file, or use one of the CDF app templates.
3
Provide app details
Provide a title and description for your application.
4
Optional. Set access restrictions
Provide a data set to restrict access to your application.
5
Start developing the application
Learn more in the CDF developer documentation and the Streamlit documentation.
Manage files
Split your project into multiple files and pages in the code editor. Import files and pages with the Pythonimport statement.
To add additional files:
1
Add a new file
Select + Add file from the side panel.
2
Select the file type
Library files are imported through Python code. Page files display as separate pages in the side panel when you run the application.
Install third-party packages
From the Settings menu, you can install third-party packages from PyPi and specify versions using pip requirement specifiers. See also limitations to packages.Manage access
Streamlit applications are stored using the Cognite Files API. To access the applications you need access to the underlying files. We recommend that you create dedicated data sets and use them to scope the access to the Streamlit applications, typically withfiles:read access for end users. App maintainers also need files:write access to the data sets.
See also capabilities for Streamlit apps.
Publish applications
Published applications are available under Custom apps in the Industrial tools workspace.Technical limitations
In CDF, Streamlit has these limitations:- Streamlit requires access to CDNs for Python packages. Organizations with firewalls that block specific traffic, may need to allow access to specific domains.
- Streamlit is based on WebAssembly. By default, WebAssembly is enabled in modern browsers, but some organizations may have disabled it on their computers.
-
CDF only supports packages written in pure Python. The error
Can't find a pure Python 3 wheel for ’\<package\>’indicates that a package relies on native libraries incompatible with Pyodide. For more details and workarounds, refer to the Pyodide documentation. - The browser environment limits network access due to cross-origin resource sharing (CORS) policies. This can affect access to external data sources and services.
- Hardware resources can limit browser-based environments. This includes access to graphics processing units (GPUs) and constraints on available memory and processing power.
-
Multithreading isn’t supported. Other functions, for example
sleep(), may not perform as expected under Pyodide.