import streamlit as st import datetime as DT import pytz import requests FONTS = [ # "Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900", # "Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900", # "Raleway:ital,wght@0,100..900;1,100..900", # "Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900", # "Nunito:ital,wght@0,200..1000;1,200..1000", # "Quicksand:wght@300..700", # "Montserrat:ital,wght@0,100..900;1,100..900", # "Edu+AU+VIC+WA+NT+Dots:wght@400..700", "Whisper", # "Merienda:wght@300..900", # "Playwrite+DE+Grund:wght@100..400", # "Roboto+Slab:wght@100..900", "Open+Sans:ital,wght@0,300..800;1,300..800", "Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000", "Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700", ] def __nowInIST() -> DT.datetime: return DT.datetime.now(pytz.timezone("Asia/Kolkata")) def pprint(log: str): now = __nowInIST() now = now.strftime("%Y-%m-%d %H:%M:%S") print(f"[{now}] [{st.session_state.ipAddress}] {log}") def __getFontsUrl(): baseLink = "https://fonts.googleapis.com/css2" params = "&".join([f"family={font}" for font in FONTS]) params = f"{params}&display=swap" fontsUrl = f"{baseLink}?{params}" # pprint(f"{fontsUrl=}") return fontsUrl def applyCommonStyles(): st.markdown( f"""
""" """ """, unsafe_allow_html=True ) def isValidImageUrl(url): if not url: return False try: imageResponse = requests.head(url, timeout=5) contentType = imageResponse.headers.get('Content-Type', '') return imageResponse.status_code == 200 and contentType.startswith('image/') except Exception: return False