Metadata-Version: 2.1
Name: streamlit-simple-gallery
Version: 0.0.4
Summary: Simple gallery for use in Streamlit projects.
Author-email: Michael Haslam <hreikin@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Michael Haslam
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/hreikin/streamlit-simple-gallery
Project-URL: Bug Tracker, https://github.com/hreikin/streamlit-simple-gallery/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit (>=1.19.0)

# Streamlit Simple Gallery

[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://hreikin-streamlit-simple-gallery-home-s3igns.streamlit.app/)

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.

```python
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:

```bash
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
```
