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.27.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbb7f21ca9777d931333703be7ec1cf57b51e58abbe8d5f0db8d09e6341775a8 |
|
MD5 | 30b6a945833a37d50dc1ebcbe6dbc37f |
|
BLAKE2b-256 | 05dabcf01e9f5632874249dfc947292a25df2d18130deff7ad10f39c18e828f7 |
Close
Hashes for streamlit_screen_stats-0.0.27-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5ab0ea8252d891a28e0bedf46d9b3ffd9e80a6664bdd5738f8d1e321985efe1 |
|
MD5 | 61dcdb677eb74b19c325b457d7163271 |
|
BLAKE2b-256 | 0141a3ab1e145c9383372ad9bce29421316534ca1936ef28dd7ece84acf6adde |