Streamlit component that allows you to get simple facts about the screen to provide custom contextual designs
Project description
streamlit-screen-stats
Streamlit component that allows you to do get various stats for your screeen to build repsonsive apps for your users with different devices.
Installation instructions
pip install streamlit-screen-stats
Usage instructions
import streamlit as st
from st_screen_stats import ScreenData, StreamlitNativeWidgetScreen, WindowQuerySize, WindowScreenRange
# using react component
screenD = ScreenData(setTimeout=1000)
screen_d = screenD.st_screen_data_window_top()
st.write(screen_d)
# using sctreamlit native widget and some custom components
# Requirements:
# Need to install from pypi:
# - streamlit-browser-session-storage (pip install streamlit-browser-session-storage)
# - streamlit-local-storage (pip install streamlit-local-storage)
screenDN = StreamlitNativeWidgetScreen(setTimeout=1000)
screenDN.st_screen_data_window_top()
stats_ = screenDN.get_window_screen_stats()
st.write(stats_)
# Query window screen like you would when using CSS @media () {}
size_r = WindowQuerySize()
val_ = size_r.mediaQuery(mediaMatchQ="(max-width: 700px)")
st.write(val_)
# Query window size based on desired range or size
rangeWindow = WindowScreenRange()
bool_res = rangeWindow.WidthUpperRange(upperRange=1000)
st.write(bool_res)
bool_res_range = rangeWindow.WidthRange(upperRange=1000, lowerRange=400)
st.write(bool_res_range)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for streamlit-screen-stats-0.0.25.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f3955e39f0844a57e792b64ce3440d483b248b09400f8b9d6bbde251fbc5495 |
|
MD5 | 5f02b6d27597a496faf30731eb65e62e |
|
BLAKE2b-256 | 23c14d217c93721f39b25f26ed40fabfbbbf949412c63da775baf377edc21704 |
Close
Hashes for streamlit_screen_stats-0.0.25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f37ea9963614df3bec223d898b282909a4c987daf1b5fed23d69d1c753ec3c62 |
|
MD5 | 223a3d60dd6c82c67411ef92121651e4 |
|
BLAKE2b-256 | 3f9efb079e9c6aada1c409ad7a55d9b3ea218d946c2e14b2f2dd66b94387f7e4 |