Simple gallery for use in Streamlit projects.
Project description
Streamlit Simple Gallery
A simple gallery for use in Streamlit projects. Check out the demo using the Streamlit Cloud button above.
Installation
Installation is available via pip:
pip install streamlit-simple-gallery
Usage
Using the gallery is simple, import streamlit_simple_gallery
and then instantiate the class with the
required directory
variable. Other options can be configured by passing in different variables
when instantiating the class.
directory
(required): Astr()
of the path to the folder containing the gallery images, for example,"assets"
.expanded
(optional): Abool()
, passingFalse
starts the expander type gallery closed, default is open andTrue
.file_extensions
(optional): Atuple()
containing strings of the file extensions to include in the gallery, default is(".png", ".jpg", ".jpeg")
.gallery_type
(optional): Astr()
with either "container" or "expander" used as the keyword, the default is"
container"`.label
(optional): Astr()
containing the name of the gallery, passingNone
disables the label. The default value is"Gallery"
.number_of_columns
(optional): Anint()
defining the number of required columns, default is5
.show_filenames
(optional): Abool()
, passingTrue
displays the filenames, the default isFalse
which hides them.
import streamlit as st
from streamlit_simple_gallery import ImageGallery
st.set_page_config(page_title="Streamlit Gallery", layout="wide")
default_gallery = ImageGallery(directory="assets")
gallery_with_columns = ImageGallery(directory="assets", label="**Gallery - Columns**", number_of_columns=3)
expander_gallery = ImageGallery(directory="assets", expanded=True, gallery_type="expander", label="**Gallery - Expander**")
multiple_options_gallery = ImageGallery(directory="assets", gallery_type="expander", label="**Gallery - Multiple Options**", number_of_columns=3, show_filename=False)
To run the example application provided in the repository:
git clone https://github.com/hreikin/streamlit-simple-gallery
cd streamlit-simple-gallery/example/
python -m venv .venv
source .venv/bin/activate
pip install streamlit-simple-gallery
streamlit run Home.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file streamlit_simple_gallery-0.0.4.tar.gz
.
File metadata
- Download URL: streamlit_simple_gallery-0.0.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 265a875d9f4a1fd847fbf4f7b0657f2a2c5bbcc9f109a9472f9e6bdfd3df1e34 |
|
MD5 | cd39679b43c70a397ebc4eb409fd7556 |
|
BLAKE2b-256 | b9ba6c06e24c9c85ddb23aa01f5eabaeafc16720991dc78587ca6b048821eb53 |
File details
Details for the file streamlit_simple_gallery-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: streamlit_simple_gallery-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36eda410ea3d9f498d0178df67e6b3a250b81749de7c89ff8709aec16dde3203 |
|
MD5 | d35803cafe5482d1607d4dc2753effb8 |
|
BLAKE2b-256 | 04e7009aa795f8fb53c003f07d105c82f0e44953ac53ecdd5bccf7c4d286c139 |