| Project Stage | Project Storyline | Hiking Analogy Storyline |
|---|---|---|
| Project Initiation | Started a machine vision and Gen-AI solution for an e-commerce company, expecting a straightforward implementation. | Embarked on a hike to a renowned Grenadian waterfall, expecting an easy journey based on initial guidance. |
| Embarking on a journey to develop a machine vision and Gen-AI based solution for auto-tagging and recommending relat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import date, datetime | |
| import streamlit as st | |
| import pandas as pd | |
| import mplfinance as mpf | |
| from pandas_datareader import data as pdr | |
| @st.experimental_memo(persist='disk') | |
| def get_historical_data(symbol, start_date = None): | |
| df = pdr.get_data_yahoo(symbol, start=start_date, end=datetime.now()) | |
| for col in df.columns: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import streamlit as st | |
| state = st.session_state | |
| if 'flask_started' not in state: | |
| state.flask_started = False | |
| def start_flask(): | |
| if state.flask_started: | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # UPDATED: 5-MAY-2023 | |
| from multiprocessing import Pool, freeze_support | |
| from time import sleep | |
| import streamlit as st | |
| # https://discuss.streamlit.io/t/stqdm-a-tqdm-like-progress-bar-for-streamlit/10097 | |
| # pip install stqdm | |
| from stqdm import stqdm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # This seems to be a common issue amongst new Streamlit users, so I wrote a mini-tutorial app to explain how widgets | |
| # are used with initialized values and how to make them stick using session state and callbacks. | |
| # | |
| # There are three ways: | |
| # | |
| # (1) The most basic where the initial value is not given but the widget is always reset, | |
| # (2) Where it’s initialized but there are issues getting the return value to stick, and finally | |
| # (3) Overcoming all issues with session state and callbacks. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # How to use: | |
| # | |
| # [1] Ensure you have `debugpy` installed: | |
| # | |
| # > pip install debugpy | |
| # | |
| # [2] In your main streamlit app: | |
| # | |
| # import streamlit_debug | |
| # streamlit_debug.set(flag=True, wait_for_client=True, host='localhost', port=8765) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import random | |
| from queue import Queue | |
| import threading | |
| import streamlit as st | |
| from streamlit.runtime.scriptrunner import add_script_run_ctx | |
| pre_msgs = [] | |
| result_msgs = [] | |
| post_msgs = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Literal | |
| import streamlit as st | |
| from streamlit.components.v1 import html | |
| FIXED_CONTAINER_CSS = """ | |
| div[data-testid="stVerticalBlockBorderWrapper"]:has(div.fixed-container-{id}):not(:has(div.not-fixed-container)) {{ | |
| position: {mode}; | |
| width: inherit; |
NewerOlder