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.26.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 544dbc323ba800c3cd0f858a7031cb158ca15a80c43423fb8d2969786d996d78 |
|
MD5 | 3765ee30393219a128997a3e394b659b |
|
BLAKE2b-256 | aa8f99daf416be8c20d15d5bba68b29b679cd3cb39f3c97f34dc2e18b0d94d31 |
Close
Hashes for streamlit_screen_stats-0.0.26-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59bad362bb5a13d6840c3f006552c10299798e6df7c3115ff9dee47521ccd59a |
|
MD5 | 71e221bdb5f8031015f65c2aea4eb66b |
|
BLAKE2b-256 | 863af0238b993bc3e99f000ae05fb1016d3394bce21a8f66d663889e5b78a2f7 |