From dbfb568b6aeea77972962904cd380036810c0698 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 13 Nov 2024 18:46:24 +0100 Subject: [PATCH] update cron industry --- app/cron_industry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/cron_industry.py b/app/cron_industry.py index 4abe8bb..e302412 100644 --- a/app/cron_industry.py +++ b/app/cron_industry.py @@ -86,10 +86,10 @@ def get_each_industry_data(): stock_data = { 'symbol': stock.get('symbol'), 'name': stock.get('name'), + 'price': stock.get('price'), 'changesPercentage': stock.get('changesPercentage'), 'marketCap': stock.get('marketCap'), 'revenue': stock.get('revenue'), - 'volume': stock.get('volume') } # Append stock data to the corresponding industry list industry_data[industry].append(stock_data) @@ -107,6 +107,8 @@ async def run(): filename = 'industries/'+format_filename(industry) stocks = [item for item in stocks if item.get('marketCap') is not None and item['marketCap'] > 0] stocks = sorted(stocks, key=lambda x: x['marketCap'], reverse=True) + for rank, item in enumerate(stocks, 1): + item['rank'] = rank history_list = [] for item in historical_pe_list: try: