Skip to content

Commit

Permalink
Fix error in CustomLibrary examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
hreikin committed Apr 1, 2023
1 parent 3fac489 commit 4711d51
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions README.md
Expand Up @@ -2,10 +2,14 @@

[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://hreikin-streamlit-uploads-library-home-ar6h9h.streamlit.app/)

A simple uploads library and gallery for use in Streamlit projects. Check out the demo using the
Streamlit Cloud button above. This package provides a simple wrapper around `st.file_uploader`
with a save function included and also provides library and gallery views for use in Streamlit
projects.
Streamlit Uploads Library is a simple, widget-based uploads library and gallery for use in
Streamlit projects. Check out the demo using the Streamlit Cloud button above.

This package provides a simple wrapper around `st.file_uploader` with a save function included and
also provides library and gallery views for use in Streamlit projects. Using any of the views is
easy, import `streamlit_uploads_library` and then instantiate the class with the required
`directory` variable. Other options can be configured by passing in different variables when
instantiating the class. More information can be found in the Github repository.

## Installation

Expand Down Expand Up @@ -95,7 +99,7 @@ import streamlit as st
from streamlit_uploads_library.library import Library

class CustomLibrary(Library):
def __init__(self, directory, file_extensions=(".png", ".jpg", ".jpeg"), image_alignment="center", number_of_columns=5, show_details=True, uid="custom"):
def __init__(self, directory, file_extensions=(".png", ".jpg", ".jpeg"), image_alignment="end", number_of_columns=5, show_details=True, uid="custom"):
self.directory = directory
self.file_extensions = file_extensions
self.image_alignment = image_alignment
Expand Down
2 changes: 1 addition & 1 deletion pages/05_Advanced.py
Expand Up @@ -33,7 +33,7 @@
from streamlit_uploads_library.library import Library
class CustomLibrary(Library):
def __init__(self, directory, file_extensions=(".png", ".jpg", ".jpeg"), image_alignment="center", number_of_columns=5, show_details=True, uid="custom"):
def __init__(self, directory, file_extensions=(".png", ".jpg", ".jpeg"), image_alignment="end", number_of_columns=5, show_details=True, uid="custom"):
self.directory = directory
self.file_extensions = file_extensions
self.image_alignment = image_alignment
Expand Down
2 changes: 1 addition & 1 deletion streamlit_uploads_library/library.py
Expand Up @@ -186,7 +186,7 @@ def create(_self, directory, file_extensions, image_alignment, number_of_columns
# from streamlit_uploads_library.library import Library
#
# class CustomLibrary(Library):
# def __init__(self, directory, file_extensions=(".png", ".jpg", ".jpeg"), image_alignment="center", number_of_columns=5, show_details=True, uid="custom"):
# def __init__(self, directory, file_extensions=(".png", ".jpg", ".jpeg"), image_alignment="end", number_of_columns=5, show_details=True, uid="custom"):
# self.directory = directory
# self.file_extensions = file_extensions
# self.image_alignment = image_alignment
Expand Down

0 comments on commit 4711d51

Please sign in to comment.