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.44.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 767d3d4402e2afc63c40d87cabeed5bc0b932d60d8a6b38b6f71662045a16310 |
|
MD5 | 5d9c4b51bc99b497e9ee7d1d10cb4b06 |
|
BLAKE2b-256 | 5c0690250d8f340627362171918dd2b687c2afb70dc6a6361c9d358e06b2c7e2 |
Close
Hashes for streamlit_screen_stats-0.0.44-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d14972951efd724b6a442517a093246546a423e756d174b8aac4af0347da3ce |
|
MD5 | af0694e01a5e36a5063fb9d3282b5c32 |
|
BLAKE2b-256 | 43808d3c78bb69dcf996bec9628689e9bae1ca4149975ade45159b47602da262 |