Simple gallery for use in Streamlit projects.
Project description
Streamlit Simple Gallery
A simple gallery for use in Streamlit projects.
Installation
Installation is 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 is `False`` 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
Close
Hashes for streamlit_simple_gallery-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5cd6e62f93e74f59a65464fa5314a7000b10bc0802a0ed55255ae71625ef4df |
|
MD5 | 31173cd0a4141233d22ac8cd6a3fef6d |
|
BLAKE2b-256 | d6b9519d9848f2f4ce1690bc2e04db63f1f7d311c8e409a572149854c8266225 |
Close
Hashes for streamlit_simple_gallery-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 057406e91f7ed9d58b5f17888de689125e2853a3905e414b870f038ddc77432a |
|
MD5 | fd337179c31f01cb18442710d49ad761 |
|
BLAKE2b-256 | 9984ceb03fd5c8eabd1c543d02018bed75adcb8cd57b597ec5ae695109da9f8b |