Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Author: @blackary
Code: https://github.com/blackary/st_pages
pip install st-pages
Basic example: https://st-pages.streamlit.app/
Example with sections: https://st-pages-sections.streamlit.app/
Previously, st-pages allowed for a much more customizable and flexible declaration of pages in a Streamlit app, and was independent of the actual filenames of the python files in your project.
As of 1.0.0, st-pages is now a tiny wrapper that provides an easy method for defining the pages in your app in a toml file, as well as a few utility methods to let you add the current page's title to all pages, etc.
You are welcome to continue to use older versions of this package, but most of the old use-cases are now easy to do with native streamlit, so I would recommend checking out the documentation for more information.
Contents of .streamlit/pages.toml
[[pages]]
path = "page1.py"
name = "Home"
icon = "🏠"
[[pages]]
path = "other_pages/page2.py"
name = "Page 2"
icon = ":books:"
url_path = "my_books" # You can override the default url path for a page
Example with sections, .stremalit/pages_sections.toml
:
[[pages]]
path = "page1.py"
name = "Home"
icon = "🏠"
[[pages]]
path = "other_pages/page2.py"
name = "Page 2"
icon = ":books:"
[[pages]]
name = "My section"
icon = "🎈️"
is_section = true
# Pages after an `is_section = true` will be indented
[[pages]]
name = "Another page"
icon = "💪"
Streamlit code:
import streamlit as st
from st_pages import add_page_title, get_nav_from_toml
st.set_page_config(layout="wide")
# If you want to use the no-sections version, this
# defaults to looking in .streamlit/pages.toml, so you can
# just call `get_nav_from_toml()`
nav = get_nav_from_toml(".streamlit/pages_sections.toml")
st.logo("logo.png")
pg = st.navigation(nav)
add_page_title(pg)
pg.run()
You can now pass a list of page names to hide_pages
to hide pages from now on.
This list of pages is custom to each viewer of the app, so you can hide pages from one viewer but not from another using this method. You can see another example of hiding pages in the docs here
from st_pages import hide_pages
hide_pages(["Another page"])
FAQs
An experimental version of Streamlit Multi-Page Apps
We found that st-pages demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.