Skip to content

Commit 7bb6818

Browse files
committed
update readme, set version to 0.0.3
1 parent 69e49d3 commit 7bb6818

2 files changed

Lines changed: 38 additions & 21 deletions

File tree

streamlit-layoutr/README.md

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,66 @@
1-
# Streamlit Component Vue Vite Template
1+
# Streamlit Layoutr Component
22

3-
A template for creating Streamlit Components. It uses Vue 3 to code the frontend and Vite to serve the files locally during development, as well as bundle and compile them for production.
3+
A Streamlit Component for Layoutr based on a template for creating Streamlit Components. It uses Vue 3 to code the frontend and Vite to serve the files locally during development, as well as bundle and compile them for production.
44

55
This repo contains templates and example code for creating [Streamlit](https://streamlit.io) Components. For complete information, please see the [Streamlit Components documentation](https://docs.streamlit.io/en/latest/streamlit_components.html)!
66

7-
## Quickstart
7+
## Development
88

9-
Ensure you have [Python 3.6+](https://www.python.org/downloads/), [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) installed.
9+
To develop the component, you need to have Node.js and npm installed. You can download them from [nodejs.org](https://nodejs.org/).
1010

11-
1. Clone this repository:
11+
1. Go to the `frontend` directory and initialize and run the component template frontend:
1212
``` bash
13-
git clone git@github.com:gabrieltempass/streamlit-component-vue-vite-template.git
14-
```
15-
16-
2. Go to the `frontend` directory and initialize and run the component template frontend:
17-
``` bash
18-
cd streamlit-component-vue-vite-template/streamlit_layoutr/frontend
13+
cd streamlit_layoutr/frontend
1914
```
2015
``` bash
2116
npm install
2217
npm run dev
2318
```
2419

25-
3. From a separate terminal, go to the repository root directory, create a new Python virtual environment, activate it and install Streamlit and the template as an editable package:
26-
``` bash
27-
cd streamlit-component-vue-vite-template
28-
```
20+
1. Set `_RELEASE = False` in `streamlit_layoutr/__init__.py`. This will pull the component live from `npm run dev` instead of the built version.
21+
22+
1. From a separate terminal, go to the repository root directory, create a new Python virtual environment, activate it and install Streamlit and the template as an editable package:
2923
``` bash
3024
python3 -m venv venv
3125
. venv/bin/activate
3226
pip install streamlit
3327
pip install -e .
3428
```
3529

36-
Still from the same separate terminal, run the example Streamlit app:
30+
1. Still from the same separate terminal, run the example Streamlit app:
3731
``` bash
3832
streamlit run streamlit_layoutr/example.py
3933
```
4034

41-
If all goes well, you should see something like this:
35+
If all goes well, you should see a sample app that lets you upload JSON and see it displayed in a graph.
36+
37+
## Deployment to PyPI
38+
39+
To deploy the component to PyPI, you need to build the frontend and package it with the Python code.
4240

43-
![Quickstart Success](quickstart.png)
41+
1. Update the version number in `setup.py`.
4442

45-
Modify the frontend code at `streamlit_layoutr/frontend/src/MyComponent.vue`.
46-
Modify the Python code at `streamlit_layoutr/__init__.py`.
43+
2. Ensure `_RELEASE = True` in `streamlit_layoutr/__init__.py`.
44+
45+
3. Build the frontend:
46+
``` bash
47+
cd streamlit_layoutr/frontend
48+
```
49+
``` bash
50+
npm run build
51+
```
52+
This will create a `dist` folder with the built files.
53+
54+
4. Go to the root directory and build the package:
55+
``` bash
56+
python3 setup.py sdist bdist_wheel
57+
```
58+
59+
5. Upload the package to PyPI (requires access to the PyPI account):
60+
``` bash
61+
pip install twine
62+
twine upload dist/*
63+
```
4764

4865
## References
4966

streamlit-layoutr/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setuptools.setup(
99
name="streamlit-layoutr",
10-
version="0.0.2",
10+
version="0.0.3",
1111
author="Kitware",
1212
author_email="kitware@kitware.com",
1313
description="Streamlit component for graph visualization",

0 commit comments

Comments
 (0)