You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__func__=get_streamlit_faker__title__="Streamlit Faker"__desc__="Fake Streamlit commands at the speed of light! Great for prototyping apps."__icon__="馃シ"__examples__= [example]
__author__="Arnaud Miribel"__github_repo__="arnaudmiribel/streamlit-faker"__pypi_name__="streamlit-faker"__package_name__="streamlit_faker"__experimental_playground__=False
With
fromcommonimportset_extra_gallery_configextra_gallery_config: dict=set_extra_gallery_config(
func=get_streamlit_faker,
title="Streamlit Faker",
desc="Fake Streamlit commands at the speed of light! Great for prototyping apps.",
...
)
And consume that extra_gallery_config variable in gallery/streamlit_app.py.
Main perks:
canonical definition of all potential config keys in set_extra_gallery_config
auto-complete unlocked for all extra configs config
makes it clear that this part in the init.py is for the gallery and has no impact whatsoever in the inner workings of the extra.
The text was updated successfully, but these errors were encountered:
@arnaudmiribel To be honest, I like the dunder attributes better because it doesn't actually run anything when you import an extra.
What if you slightly modified this, and make a standardized required method called _get_extra_config() or something like that, which then calls (and returns the output of) set_extra_gallery_config inside of it? Then the gallery app would go through, make sure that _get_extra_config() is defined, and call it. I'm not 100% sure I'm sold on that, but I just would like us to stick to "imports don't have side-effects" as much as possible. WDYT?
Replace this
With
And consume that
extra_gallery_config
variable ingallery/streamlit_app.py
.Main perks:
set_extra_gallery_config
The text was updated successfully, but these errors were encountered: