Skip to content

Commit

Permalink
Update env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
paty-oliveira committed Sep 28, 2024
1 parent f503ec3 commit dfdbb27
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ matplotlib~=3.9.2
numpy~=2.1.0
toml~=0.10.2
beautifulsoup4
python-dotenv
8 changes: 3 additions & 5 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os

import toml
from dotenv import load_dotenv

import core
import infra
Expand All @@ -23,10 +21,10 @@ def initialize_financial_formulas():


def main():
configs = toml.load(os.path.abspath("config.toml"))
load_dotenv()
initialize_financial_provider(infra.YAHOO)
initialize_financial_formulas()
ui.run(_financial_provider, _financial_calculations, configs)
ui.run(_financial_provider, _financial_calculations)


if __name__ == "__main__":
Expand Down
11 changes: 6 additions & 5 deletions src/ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pathlib

import streamlit as st
Expand All @@ -10,10 +11,10 @@
initial_state = {"ticker": "", "balance_sheet_frequency": "yearly"}


def run(financial_data, financial_calculations, configs):
feedback_form_url = configs["general"]["feedback_form_url"]
contribution_url = configs["general"]["contribution_url"]
ga_tracking_id = configs["general"]["ga_tracking_id"]
def run(financial_data, financial_calculations):
feedback_form_url = os.getenv("FEEDBACK_FORM_URL")
donation_url = os.getenv("DONATION_URL")
ga_tracking_id = os.getenv("GA_TRACKING_ID")

st.set_page_config(
page_title="Stock Analysis Dashboard",
Expand Down Expand Up @@ -57,4 +58,4 @@ def run(financial_data, financial_calculations, configs):

# performs the rendering
render_layout(financial_data, financial_calculations)
render_sidebar(feedback_form_url, contribution_url)
render_sidebar(feedback_form_url, donation_url)
4 changes: 2 additions & 2 deletions src/ui/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from streamlit_extras.buy_me_a_coffee import button


def render(feedback_form_url, contribution_url):
def render(feedback_form_url, donation_url):
with st.sidebar:
st.title("Dashboard :bar_chart:")
st.text_input("Enter a stock ticker:", key="ticker", type="default")
button(username=contribution_url, floating=True)
button(username=donation_url, floating=True)

with st.container():
st.write("### We would love your feedback!")
Expand Down

0 comments on commit dfdbb27

Please sign in to comment.