diff --git a/app/cron_dark_pool_flow.py b/app/cron_dark_pool_flow.py index 1a13d7c..f091659 100644 --- a/app/cron_dark_pool_flow.py +++ b/app/cron_dark_pool_flow.py @@ -11,9 +11,9 @@ import os load_dotenv() -api_key = os.getenv('INTRINIO_API_KEY') +API_KEY = os.getenv('INTRINIO_API_KEY') -intrinio.ApiClient().set_api_key(api_key) +intrinio.ApiClient().set_api_key(API_KEY) intrinio.ApiClient().allow_retries(True) def save_json(data): diff --git a/app/cron_retail_volume.py b/app/cron_retail_volume.py index da8cee2..a83b262 100644 --- a/app/cron_retail_volume.py +++ b/app/cron_retail_volume.py @@ -84,7 +84,7 @@ async def run(): total_symbols = stocks_symbols+etf_symbols - chunk_size = len(total_symbols) // 70 # Divide the list into N chunks + chunk_size = len(total_symbols) // 700 # Divide the list into N chunks chunks = [total_symbols[i:i + chunk_size] for i in range(0, len(total_symbols), chunk_size)] most_retail_volume = [] @@ -124,7 +124,9 @@ async def run(): #Add stocks for most retail volume if symbol in stocks_symbols: - most_retail_volume.append({'symbol': res[-1]['symbol'], 'name': name, 'traded': res[-1]['traded'], 'sentiment': res[-1]['sentiment'], 'retailStrength': retailer_strength}) + most_retail_volume.append({'symbol': res[-1]['symbol'], 'name': name, 'assetType': 'stocks','traded': res[-1]['traded'], 'sentiment': res[-1]['sentiment'], 'retailStrength': retailer_strength}) + elif symbol in etf_symbols: + most_retail_volume.append({'symbol': res[-1]['symbol'], 'name': name, 'assetType': 'etf', 'traded': res[-1]['traded'], 'sentiment': res[-1]['sentiment'], 'retailStrength': retailer_strength}) except Exception as e: print(e) diff --git a/app/main.py b/app/main.py index 5bd3b0f..d1685c2 100755 --- a/app/main.py +++ b/app/main.py @@ -1997,14 +1997,14 @@ async def get_earnings_call_transcripts(data:TranscriptData, api_key: str = Secu quarter = data['quarter'] cache_key = f"earnings-call-transcripts-{ticker}-{year}-{quarter}" cached_result = redis_client.get(cache_key) - print(data) + if cached_result: return orjson.loads(cached_result) try: async with aiohttp.ClientSession() as session: url = f"https://financialmodelingprep.com/api/v3/earning_call_transcript/{ticker}?year={year}&quarter={quarter}&apikey={FMP_API_KEY}" - print(url) + async with session.get(url) as response: data = (await response.json())[0]