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()
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.37.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5973ac9c4322d0a3fa10122c3d5eb11cdb07d5d3f9c78f00362903f1b2ab3c7d |
|
MD5 | f14be9d8758fcbe372e208c417394354 |
|
BLAKE2b-256 | 0e1dfa84a476109c200bd7aa104d7c0ae0dc627642e966aa2024c3016f3a5a00 |
Close
Hashes for streamlit_screen_stats-0.0.37-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aaecbdc52603b7630d99085f7d1452415214a20d8eda2171c79143f9af99294 |
|
MD5 | c76d2967e228751524f740cf16bf950b |
|
BLAKE2b-256 | 5eb1d9e9f7d0e9a3272bb73d2c37796de9dd47d92024807eec19eb5b405b3bea |