Cognite 3D Reveal Streamlit
This is a Streamlit library that can be used to show 3D models inside a Streamlit app. It works especially good when used inside Streamlit in Fusion, but can also be used in standalone Streamlit apps.
How to install
You simply install it by running
pip install cognite-streamlit-reveal
How to use
Here is an example app
import streamlit as st
import os
from cognite.streamlit import reveal
from cognite.client import CogniteClient
st.subheader("Cognite Reveal Streamlit example")
client = CogniteClient()
model_id = 123
revision_id = 234
selected_node_id = reveal(client, model_id, revision_id)
st.markdown("Selected node id: %d!" % int(selected_node_id))
Local development
It's recommended to add a clean environment. You need pip and node.
Clone repo
git clone https://github.com/cognitedata/hackathon-reveal-streamlit.git
Install Python packages
pip install streamlit
Install NPM packages and start server
cd cognite/streamlit/reveal/frontend
yarn
HTTPS=true yarn start
Then open https://localhost:3001/ to accept bad certificate.
Open repo folder in another terminal. Install this package as development package
pip install -e .
Extract a token from Fusion, and start with
COGNITE_TOKEN="TOKEN" streamlit run examples/example.py
Local development in fusion stlite
Make sure you have set (reveal/init.py:8)[reveal/init.py:8] to _RELEASE = True.
Step 1) Build front end component with cd reveal/frontend && yarn && yarn build
Step 2) Build streamlit component with python -m build (hint: pip install build)
Step 3) Start local server python server.py
Open Fusion, create a Streamlit app and add the following the installed package
http://localhost:8000/dist/reveal_streamlit_component-0.0.1-py3-none-any.whl
It will then load successfully inside Stlite.
Metadata
Release files for andeplane-reveal-streamlit-component 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| andeplane_reveal_streamlit_component-0.1.5.tar.gz | 6.0 MB | Without provenance | Details for andeplane_reveal_streamlit_component-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| andeplane_reveal_streamlit_component-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for andeplane_reveal_streamlit_component-0.1.5-py3-none-any.whl |
Total release size: 12.1 MB
Release files / andeplane_reveal_streamlit_component-0.1.5.tar.gz
| Download URL | andeplane_reveal_streamlit_component-0.1.5.tar.gz |
|---|---|
| Size | 6.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dda3fa430e516c568330d295a9353eb5bbdf5da04b6b593c33bff29469005471
|
|
BLAKE2b-256 checksum How to use checksums |
cc36fd4ed5ffa6ebafc4837205b11e1d5c8c083179e0a0de5be529449bb97f32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / andeplane_reveal_streamlit_component-0.1.5-py3-none-any.whl
| Download URL | andeplane_reveal_streamlit_component-0.1.5-py3-none-any.whl |
|---|---|
| Size | 6.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd00f671303e0405a911657514da37686131c2d7e39ea4f5e0b3e5ca281add46
|
|
BLAKE2b-256 checksum How to use checksums |
68ed29044ac7b615ade9260310c13781f6a5a83ba8bd470b0e294e2dd6e75a49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Security for andeplane-reveal-streamlit-component 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.