Name | andeplane-reveal-streamlit-component JSON |
Version |
0.1.5
JSON |
| download |
home_page | None |
Summary | Streamlit wrapper for Cognite Reveal to view 3D content from Cognite Data Fsion |
upload_time | 2024-04-19 13:42:29 |
maintainer | None |
docs_url | None |
author | John Smith |
requires_python | >=3.7 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "andeplane-reveal-streamlit-component",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "John Smith",
"author_email": "john@example.com",
"download_url": "https://files.pythonhosted.org/packages/cc/36/fd4ed5ffa6ebafc4837205b11e1d5c8c083179e0a0de5be529449bb97f32/andeplane_reveal_streamlit_component-0.1.5.tar.gz",
"platform": null,
"description": "# Cognite 3D Reveal Streamlit\n\nThis 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.\n\n## How to install\n\nYou simply install it by running\n`pip install cognite-streamlit-reveal`\n\n## How to use\n\nHere is an example app\n\n```\nimport streamlit as st\nimport os\nfrom cognite.streamlit import reveal\nfrom cognite.client import CogniteClient\n\nst.subheader(\"Cognite Reveal Streamlit example\")\nclient = CogniteClient()\nmodel_id = 123\nrevision_id = 234\n\nselected_node_id = reveal(client, model_id, revision_id)\nst.markdown(\"Selected node id: %d!\" % int(selected_node_id))\n\n```\n\n## Local development\n\nIt's recommended to add a clean environment. You need `pip` and `node`.\n\nClone repo\n`git clone https://github.com/cognitedata/hackathon-reveal-streamlit.git`\n\nInstall Python packages\n`pip install streamlit`\n\nInstall NPM packages and start server\n\n```\ncd cognite/streamlit/reveal/frontend\nyarn\nHTTPS=true yarn start\n```\n\nThen open https://localhost:3001/ to accept bad certificate.\n\nOpen repo folder in another terminal. Install this package as development package\n`pip install -e .`\n\nExtract a token from Fusion, and start with\n\n`COGNITE_TOKEN=\"TOKEN\" streamlit run examples/example.py`\n\n### Local development in fusion stlite\n\nMake sure you have set (reveal/**init**.py:8)[reveal/__init__.py:8] to `_RELEASE = True`.\n\nStep 1) Build front end component with `cd reveal/frontend && yarn && yarn build`\nStep 2) Build streamlit component with `python -m build` (hint: `pip install build`)\nStep 3) Start local server `python server.py`\n\nOpen Fusion, create a Streamlit app and add the following the installed package\n`http://localhost:8000/dist/reveal_streamlit_component-0.0.1-py3-none-any.whl`\n\nIt will then load successfully inside Stlite.\n",
"bugtrack_url": null,
"license": null,
"summary": "Streamlit wrapper for Cognite Reveal to view 3D content from Cognite Data Fsion",
"version": "0.1.5",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "68ed29044ac7b615ade9260310c13781f6a5a83ba8bd470b0e294e2dd6e75a49",
"md5": "5308cb2ec1aa6740919031333e997a13",
"sha256": "cd00f671303e0405a911657514da37686131c2d7e39ea4f5e0b3e5ca281add46"
},
"downloads": -1,
"filename": "andeplane_reveal_streamlit_component-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5308cb2ec1aa6740919031333e997a13",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6072093,
"upload_time": "2024-04-19T13:42:26",
"upload_time_iso_8601": "2024-04-19T13:42:26.399263Z",
"url": "https://files.pythonhosted.org/packages/68/ed/29044ac7b615ade9260310c13781f6a5a83ba8bd470b0e294e2dd6e75a49/andeplane_reveal_streamlit_component-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc36fd4ed5ffa6ebafc4837205b11e1d5c8c083179e0a0de5be529449bb97f32",
"md5": "a192aa8eaaf34f728c41295143b4fa23",
"sha256": "dda3fa430e516c568330d295a9353eb5bbdf5da04b6b593c33bff29469005471"
},
"downloads": -1,
"filename": "andeplane_reveal_streamlit_component-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "a192aa8eaaf34f728c41295143b4fa23",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6019294,
"upload_time": "2024-04-19T13:42:29",
"upload_time_iso_8601": "2024-04-19T13:42:29.296144Z",
"url": "https://files.pythonhosted.org/packages/cc/36/fd4ed5ffa6ebafc4837205b11e1d5c8c083179e0a0de5be529449bb97f32/andeplane_reveal_streamlit_component-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-19 13:42:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "andeplane-reveal-streamlit-component"
}