Name | streamlit-image-select-jun JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | 🖼️ An image select component for Streamlit |
upload_time | 2024-05-26 18:41:06 |
maintainer | None |
docs_url | None |
author | Johannes Rieke |
requires_python | !=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# streamlit-image-select 🖼️
[![PyPI](https://img.shields.io/pypi/v/streamlit-image-select)](https://pypi.org/project/streamlit-image-select/)
**An image select component for Streamlit.**
This custom component works just like `st.selectbox` but with images. It's a great option
if you want to let the user select an example image, e.g. for a computer vision app!
---
<h3 align="center">
🏃 <a href="https://image-select.streamlitapp.com/">Try out the demo app</a> 🏃
</h3>
---
<p align="center">
<a href="https://image-select.streamlitapp.com/"><img src="images/demo.gif" width=600></a>
</p>
## Installation
```bash
pip install streamlit-image-select
```
## Usage
```python
from streamlit_image_select import image_select
img = image_select("Label", ["image1.png", "image2.png", "image3.png"])
st.write(img)
```
See [the demo app](https://image-select.streamlitapp.com/) for a detailed guide!
## Development
> **Warning**
> You only need to run these steps if you want to change this component or
contribute to its development!
### Setup
First, clone the repository:
```bash
git clone https://github.com/jrieke/streamlit-image-select.git
cd streamlit-image-select
```
Install the Python dependencies:
```bash
poetry install --dev
```
And install the frontend dependencies:
```bash
cd streamlit_image_select/frontend
npm install
```
### Making changes
To make changes, first go to `streamlit_image_select/__init__.py` and make sure the
variable `_RELEASE` is set to `False`. This will make the component use the local
version of the frontend code, and not the built project.
Then, start one terminal and run:
```bash
cd streamlit_image_select/frontend
npm start
```
This starts the frontend code on port 3001.
Open another terminal and run:
```bash
cp demo/streamlit_app.py .
poetry shell
streamlit run streamlit_app.py
```
This copies the demo app to the root dir (so you have something to work with and see
your changes!) and then starts it. Now you can make changes to the Python or Javascript
code in `streamlit_image_select` and the demo app should update automatically!
If nothing updates, make sure the variable `_RELEASE` in `streamlit_image_select/__init__.py` is set to `False`.
### Publishing on PyPI
Switch the variable `_RELEASE` in `streamlit_image_select/__init__.py` to `True`.
Increment the version number in `pyproject.toml`. Make sure the copy of the demo app in
the root dir is deleted or merged back into the demo app in `demo/streamlit_app.py`.
Build the frontend code with:
```bash
cd streamlit_image_select/frontend
npm run build
```
After this has finished, build and upload the package to PyPI:
```bash
cd ../..
poetry build
poetry publish
```
## Changelog
### 0.6.0 (March 28, 2023)
- Removed `st.experimental_memo`, which is deprecated.
- Changed minimum version of Streamlit to 1.19.
### 0.5.1 (November 20, 2022)
- Hotfix, forgot to switch the RELEASE variable back to True :wink:
### 0.5.0 (November 20, 2022)
- Added `return_value` parameter to be able to get the index of the selected image.
- Improved error messages.
### 0.4.0 (November 20, 2022)
- Added `index` parameter to set the initially selected image.
- Improved input arg checks.
### 0.3.0 (November 13, 2022)
- Added `use_container_width` parameter to customize the width of the component.
- Made `key` and `use_container_width` parameters keyword-only.
- Refactored CSS classes.
Raw data
{
"_id": null,
"home_page": null,
"name": "streamlit-image-select-jun",
"maintainer": null,
"docs_url": null,
"requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Johannes Rieke",
"author_email": "johannes.rieke@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/bb/4c/5647398df2eeab22921b5b377048a60c1e4b5a2efbf6d1a40645bac92fd1/streamlit-image-select-jun-0.0.1.tar.gz",
"platform": null,
"description": "# streamlit-image-select \ud83d\uddbc\ufe0f\n\n[![PyPI](https://img.shields.io/pypi/v/streamlit-image-select)](https://pypi.org/project/streamlit-image-select/)\n\n**An image select component for Streamlit.**\n\nThis custom component works just like `st.selectbox` but with images. It's a great option\nif you want to let the user select an example image, e.g. for a computer vision app!\n\n---\n\n<h3 align=\"center\">\n \ud83c\udfc3 <a href=\"https://image-select.streamlitapp.com/\">Try out the demo app</a> \ud83c\udfc3\n</h3>\n\n---\n\n<p align=\"center\">\n <a href=\"https://image-select.streamlitapp.com/\"><img src=\"images/demo.gif\" width=600></a>\n</p>\n\n\n## Installation\n\n```bash\npip install streamlit-image-select\n```\n\n## Usage\n\n```python\nfrom streamlit_image_select import image_select\nimg = image_select(\"Label\", [\"image1.png\", \"image2.png\", \"image3.png\"])\nst.write(img)\n```\n\nSee [the demo app](https://image-select.streamlitapp.com/) for a detailed guide!\n\n\n## Development\n\n> **Warning**\n> You only need to run these steps if you want to change this component or \ncontribute to its development!\n\n### Setup\n\nFirst, clone the repository:\n\n```bash\ngit clone https://github.com/jrieke/streamlit-image-select.git\ncd streamlit-image-select\n```\n\nInstall the Python dependencies:\n\n```bash\npoetry install --dev\n```\n\nAnd install the frontend dependencies:\n\n```bash\ncd streamlit_image_select/frontend\nnpm install\n```\n\n### Making changes\n\nTo make changes, first go to `streamlit_image_select/__init__.py` and make sure the \nvariable `_RELEASE` is set to `False`. This will make the component use the local \nversion of the frontend code, and not the built project. \n\nThen, start one terminal and run:\n\n```bash\ncd streamlit_image_select/frontend\nnpm start\n```\n\nThis starts the frontend code on port 3001.\n\nOpen another terminal and run:\n\n```bash\ncp demo/streamlit_app.py .\npoetry shell\nstreamlit run streamlit_app.py\n```\n\nThis copies the demo app to the root dir (so you have something to work with and see \nyour changes!) and then starts it. Now you can make changes to the Python or Javascript \ncode in `streamlit_image_select` and the demo app should update automatically!\n\nIf nothing updates, make sure the variable `_RELEASE` in `streamlit_image_select/__init__.py` is set to `False`. \n\n\n### Publishing on PyPI\n\nSwitch the variable `_RELEASE` in `streamlit_image_select/__init__.py` to `True`. \nIncrement the version number in `pyproject.toml`. Make sure the copy of the demo app in \nthe root dir is deleted or merged back into the demo app in `demo/streamlit_app.py`.\n\nBuild the frontend code with:\n\n```bash\ncd streamlit_image_select/frontend\nnpm run build\n```\n\nAfter this has finished, build and upload the package to PyPI:\n\n```bash\ncd ../..\npoetry build\npoetry publish\n```\n\n## Changelog\n\n### 0.6.0 (March 28, 2023)\n- Removed `st.experimental_memo`, which is deprecated. \n- Changed minimum version of Streamlit to 1.19.\n \n### 0.5.1 (November 20, 2022)\n- Hotfix, forgot to switch the RELEASE variable back to True :wink:\n\n### 0.5.0 (November 20, 2022)\n- Added `return_value` parameter to be able to get the index of the selected image.\n- Improved error messages. \n\n### 0.4.0 (November 20, 2022)\n- Added `index` parameter to set the initially selected image.\n- Improved input arg checks. \n\n### 0.3.0 (November 13, 2022)\n- Added `use_container_width` parameter to customize the width of the component. \n- Made `key` and `use_container_width` parameters keyword-only.\n- Refactored CSS classes.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\ud83d\uddbc\ufe0f An image select component for Streamlit",
"version": "0.0.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bec974456f7777a7e2d2aeef1bad20bfa92964127cb0460a8194a77f272b635a",
"md5": "ceda849adaa736a3dfae7f0efde833f2",
"sha256": "196bf51865427f10f87c98ce32c0e8b27075c5ab0138716a781e5aeb95ffde68"
},
"downloads": -1,
"filename": "streamlit_image_select_jun-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ceda849adaa736a3dfae7f0efde833f2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8",
"size": 358822,
"upload_time": "2024-05-26T18:41:09",
"upload_time_iso_8601": "2024-05-26T18:41:09.764773Z",
"url": "https://files.pythonhosted.org/packages/be/c9/74456f7777a7e2d2aeef1bad20bfa92964127cb0460a8194a77f272b635a/streamlit_image_select_jun-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bb4c5647398df2eeab22921b5b377048a60c1e4b5a2efbf6d1a40645bac92fd1",
"md5": "8cad651e11a466b46e638a89eea20377",
"sha256": "6a13bc5d5df7530a1736b7b093899a5e8abcfccd852bc963f02bc87bba5071c7"
},
"downloads": -1,
"filename": "streamlit-image-select-jun-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "8cad651e11a466b46e638a89eea20377",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8",
"size": 354656,
"upload_time": "2024-05-26T18:41:06",
"upload_time_iso_8601": "2024-05-26T18:41:06.179497Z",
"url": "https://files.pythonhosted.org/packages/bb/4c/5647398df2eeab22921b5b377048a60c1e4b5a2efbf6d1a40645bac92fd1/streamlit-image-select-jun-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-26 18:41:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "streamlit-image-select-jun"
}