update dashboard
This commit is contained in:
parent
b36131595b
commit
02f836ff56
@ -280,7 +280,7 @@ async def get_analyst_report():
|
|||||||
with sqlite3.connect('stocks.db') as con:
|
with sqlite3.connect('stocks.db') as con:
|
||||||
cursor = con.cursor()
|
cursor = con.cursor()
|
||||||
cursor.execute("PRAGMA journal_mode = wal")
|
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
|
symbols = {row[0] for row in cursor.fetchall()} # Use a set for fast lookups
|
||||||
|
|
||||||
# Define the directory path
|
# Define the directory path
|
||||||
|
|||||||
@ -194,6 +194,7 @@ def process_financial_data(file_path, key_list):
|
|||||||
value = float(res[key])
|
value = float(res[key])
|
||||||
if 'growth' in file_path or key in ['grossProfitMargin','netProfitMargin','pretaxProfitMargin','operatingProfitMargin','longTermDebtToCapitalization','totalDebtToCapitalization']:
|
if 'growth' in file_path or key in ['grossProfitMargin','netProfitMargin','pretaxProfitMargin','operatingProfitMargin','longTermDebtToCapitalization','totalDebtToCapitalization']:
|
||||||
value *= 100 # Multiply by 100 for percentage
|
value *= 100 # Multiply by 100 for percentage
|
||||||
|
|
||||||
data[key] = round(value, 2) if value is not None else None
|
data[key] = round(value, 2) if value is not None else None
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
# If there's an issue converting the value, leave it as None
|
# If there's an issue converting the value, leave it as None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user