From 02f836ff56a844d7ab6432ab53593dafb924a6fa Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Mon, 9 Dec 2024 10:14:48 +0100 Subject: [PATCH] update dashboard --- app/cron_dashboard.py | 2 +- app/restart_json.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/cron_dashboard.py b/app/cron_dashboard.py index a50ef39..224df0d 100644 --- a/app/cron_dashboard.py +++ b/app/cron_dashboard.py @@ -280,7 +280,7 @@ async def get_analyst_report(): with sqlite3.connect('stocks.db') as con: cursor = con.cursor() cursor.execute("PRAGMA journal_mode = wal") - cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE symbol NOT LIKE '%.%' AND symbol NOT LIKE '%-%' AND marketCap > 50E9") + cursor.execute("SELECT DISTINCT symbol FROM stocks WHERE symbol NOT LIKE '%.%' AND symbol NOT LIKE '%-%' AND marketCap > 10E9") symbols = {row[0] for row in cursor.fetchall()} # Use a set for fast lookups # Define the directory path diff --git a/app/restart_json.py b/app/restart_json.py index 279acc4..0dbfb89 100755 --- a/app/restart_json.py +++ b/app/restart_json.py @@ -194,6 +194,7 @@ def process_financial_data(file_path, key_list): value = float(res[key]) if 'growth' in file_path or key in ['grossProfitMargin','netProfitMargin','pretaxProfitMargin','operatingProfitMargin','longTermDebtToCapitalization','totalDebtToCapitalization']: value *= 100 # Multiply by 100 for percentage + data[key] = round(value, 2) if value is not None else None except (ValueError, TypeError): # If there's an issue converting the value, leave it as None