Skip to main content

No project description provided

Project description

Streamlit Activities Menu

Builds an interactive activities menu to create a multi-page app using Streamlit's sidebar selectbox, as an alternative to the pages implementation. The available activities (pages) are read from a yaml file. These activities can be used to create a multi-page app using Streamlit.

It is recommended to add the app_activities.yaml at the same level as the main streamlit_app.py. Then, an activities folder is recommended to exist as a subdirectory where the streamlit_app.py is located.

The app_activities.yaml follows the following schema:

# Services for multipage Streamlit app
-
  name: 'Home Page'
  description: 'Home page'
  url: "home.py"

-
  name: 'Data Overview'
  description: 'Overall data overview'
  url: "overview.py"

- 
  name: 'Data Processing'
  description: 'Processing page'
  url: "processing.py"

# Add as required

In the streamlit_app.py:

import os
import streamlit as st
from streamlit_activities_menu import get_available_activities, build_activities_menu

# Load the available activities
ACTIVITIES_FILEPATH = st.secrets['PATHS']['ACTIVITIES_FILEPATH']
ACTIVITIES_DIRPATH = st.secrets['PATHS']['ACTIVITIES_DIRPATH']

# Load the `yaml` file with core activities    
core_activities = get_available_activities(
    activities_filepath=os.path.abspath(ACTIVITIES_FILEPATH)        
)

build_activities_menu(
    activities_dict=core_activities, 
    label='**Menu:**', 
    key='activitiesMenu', 
    activities_dirpath=os.path.abspath(ACTIVITIES_DIRPATH),
    disabled=False
    )

Subfolders

The recommended structure of the files within the subdirectory is:

my_app
|-- streamlit_app.py
|-- app_activities.yaml
|-- activities
|   |-- home.py
|   |-- overview.py
|   |-- processing.py

Mantainers

  • José M. Beltrán-Abaunza, PhD | Lund University, Department of Physical Geography and Ecosystem Science

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_activities_menu-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_activities_menu-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_activities_menu-0.1.2.tar.gz.

File metadata

  • Download URL: streamlit_activities_menu-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for streamlit_activities_menu-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7ac0e753ec8df97de01e4b70af6588377d1ff615b91470f8f19e0498a03201e4
MD5 c8d817c28a3cf82bd6a76515dd1fb965
BLAKE2b-256 c2786a577a9f0950cb48ed9d31e8a88e1963f6f48073a086d6afc12856ba9ba4

See more details on using hashes here.

File details

Details for the file streamlit_activities_menu-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: streamlit_activities_menu-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for streamlit_activities_menu-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2cfe6cf403007e2b3b3d07555522c531d41c02e827a3143709cb77aea38d95
MD5 9b3b53f25abd0a08363bd2192bc37bb9
BLAKE2b-256 4751da5b23510459be9d8fb74bd28e2735a291877fcea821a87be7db89364785

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page