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.31.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4bf945b566f055f9436b64939b02e0ece094a2816c5948b639d86ee7bda564 |
|
MD5 | ce2e3eaf245789d533f64f8d5faaa768 |
|
BLAKE2b-256 | f1830e23d8d46f21d9d39ca48f2696d83d502506067dd373bd170e3a0bf939b0 |
Close
Hashes for streamlit_screen_stats-0.0.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d360444178bc5da18c034d5c9b045d96ae5545124a53d80f85b98e94f5809f0b |
|
MD5 | 33477667c109b28bb167464181ffa1d5 |
|
BLAKE2b-256 | 7fdb4ff6a826c92557a99741b44e0199b41c19de2f58986573dda82d94b6ec74 |