Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coming soon] Create multipages app programmatically #4866

Open
PaleNeutron opened this issue Jun 14, 2022 · 10 comments
Open

[Coming soon] Create multipages app programmatically #4866

PaleNeutron opened this issue Jun 14, 2022 · 10 comments
Labels
feature:multipage-apps type:enhancement Requests for feature enhancements or new features

Comments

@PaleNeutron
Copy link
Contributor

PaleNeutron commented Jun 14, 2022

Currently, if we want to create a multipages app, we have to put page files into pages folder and give them names like 1_pageapple.py, and pageapple will show as label on web page.

This will make three problems:

  1. It is hard to arrange pages. if I already have 10 pages and I want to insert a new page in index 2, I have to rename 8 files.
  2. The web project structure is too rigid, we can not put some util modules in pages directory or put different pages in any where we like.
  3. filename is not clean. Actually, label on web page is not the style of my filenames, I do not like emoji in my filenames.

I think streamlit at least should provide a manually model, just like:

st.config(auto_pages=False)

st.add_pages(
  {
  "🌲label1_name%test": "page1_file_path.py",
  "📚label2_name": "folder/page1_file_path.py",
  }
)

Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

@PaleNeutron PaleNeutron added type:enhancement Requests for feature enhancements or new features status:needs-triage Has not been triaged by the Streamlit team labels Jun 14, 2022
@andreaschiappacasse
Copy link

+1, would love this

@gaspardc-met
Copy link

+1 on @PaleNeutron 's suggestion,

  • having emojis in filename is uncomfortable and seems rather unnecessary to obtain the desired outcome
  • It collides with path autocomplete in the terminal, with good practices and linters (like pylint) and for good reasons 👍
  • defining the pages manually allows for finer page controls (some pages should not be displayed when the webapp is in production, for example)

@jrieke
Copy link
Collaborator

jrieke commented Jul 1, 2022

Hey all!

Thanks for your feedback, this is super helpful. We definitely want to fix most of the issues you mentioned, since we heard similar feedback from other users. I don't know yet in which way we'll solve it, but we are on it! ;)

@gaspardc-met
Copy link

Hey @jrieke ,

Thanks for the update on this issue, available to discuss use cases and why we'd love finer control over the page definition for production web apps 👍

@jrieke
Copy link
Collaborator

jrieke commented Jul 7, 2022

@gaspard-met Yeah actually it would be great to discuss if you have more advanced use cases! Want to shoot me an email at johannes.rieke@snowflake.com, and we can schedule something if you like?

@gaspardc-met
Copy link

Hi @jrieke ,

I had missed your prompt answer, my bad
Just sent you an email, if it's still relevant

@nbttn1
Copy link

nbttn1 commented Aug 25, 2022

Great idea. This would allow us to control how the labels look, independent of the filenames. For example, the landing page might be main.py, but we want to label it "My Home Page". Hope this idea makes it into streamlit.

@jrieke
Copy link
Collaborator

jrieke commented Oct 10, 2022

Note to myself: also look at #5506, which contains some ideas on how to do this with a YAML file.

@carolinedlu carolinedlu changed the title Create multipages app by code Create multipages app programmatically Nov 10, 2022
@matkozak
Copy link

matkozak commented Dec 9, 2022

Having a configuration file would be nice, but personally I am really interested in the ability to display pages conditionally.

@marcosberghahn
Copy link

I also want to show and hide pages conditionally! For different user groups.

@LukasMasuch LukasMasuch changed the title Create multipages app programmatically [Coming soon] Create multipages app programmatically Apr 10, 2024
@sfc-gh-lmasuch sfc-gh-lmasuch pinned this issue May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:multipage-apps type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

9 participants