update dashboard

This commit is contained in:
MuslemRahimi 2024-12-09 10:14:48 +01:00
parent b36131595b
commit 02f836ff56
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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