Skip to main content

Streamlit Simple Gallery

Open in Streamlit

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): A str() of the path to the folder containing the gallery images, for example, "assets".
  • expanded (optional): A bool(), passing False starts the expander type gallery closed, default is open and True.
  • file_extensions (optional): A tuple() containing strings of the file extensions to include in the gallery, default is (".png", ".jpg", ".jpeg").
  • gallery_type (optional): A str() with either "container" or "expander" used as the keyword, the default is "container"`.
  • label (optional): A str() containing the name of the gallery, passing None disables the label. The default value is "Gallery".
  • number_of_columns (optional): An int() defining the number of required columns, default is 5.
  • show_filenames (optional): A bool(), passing True 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

Metadata

Release files for streamlit-simple-gallery 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-simple-gallery 0.0.4
File Size Uploaded Provenance
streamlit_simple_gallery-0.0.4.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-simple-gallery 0.0.4
File Interpreter ABI Platform
streamlit_simple_gallery-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Security for streamlit-simple-gallery 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page