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.34.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45d2d4cc461d66e318ce8b899e0e72864fcd4b03100fca72a3de889a9a3d1bf6 |
|
MD5 | bb8fb2807543c765db14f059d533750b |
|
BLAKE2b-256 | d6b7a3848c3e034d8ed01e33afe90f0e348619f64a322f87d0df91f7f8844301 |
Close
Hashes for streamlit_screen_stats-0.0.34-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9a74cb9f7df94129b3cd3a99e46578b09ed68c6925d62ba8eed038a03c92ee |
|
MD5 | 65a23b03fe1a5f9647ff0bb32387c7cf |
|
BLAKE2b-256 | 594afbf20c3b75a47a97c2c5c5d924c9a7e841db57d46347a89ffb34840a9970 |