diff --git a/app/cron_options_flow.py b/app/cron_options_flow.py index aa4b8be..30689c6 100755 --- a/app/cron_options_flow.py +++ b/app/cron_options_flow.py @@ -35,7 +35,7 @@ def process_page(page): try: data = fin.options_activity(date_from=start_date, date_to=end_date, page=page, pagesize=1000) data = ujson.loads(fin.output(data))['option_activity'] - filtered_data = [{key: value for key, value in item.items() if key in ['ticker','time', 'id','sentiment','underlying_price', 'cost_basis', 'underlying_price','option_activity_type','date', 'date_expiration', 'open_interest','price', 'put_call','strike_price', 'volume']} for item in data] + filtered_data = [{key: value for key, value in item.items() if key not in ['description_extended','updated']} for item in data] time.sleep(1) page_list = [] for item in filtered_data: @@ -59,6 +59,8 @@ def process_page(page): item['underlying_price'] = round(float(item['underlying_price']), 2) item['type'] = item['option_activity_type'].capitalize() item['sentiment'] = item['sentiment'].capitalize() + item['executionEstimate'] = item['execution_estimate'].replace('_', ' ').title() + item['tradeCount'] = item['trade_count'] page_list.append(item) diff --git a/app/main.py b/app/main.py index 9ed2a2e..b1d44ac 100755 --- a/app/main.py +++ b/app/main.py @@ -1974,6 +1974,7 @@ async def get_earnings_call_transcripts(data:TranscriptData): quarter = data['quarter'] cache_key = f"earnings-call-transcripts-{ticker}-{year}-{quarter}" cached_result = redis_client.get(cache_key) + if cached_result: return ujson.loads(cached_result) @@ -1987,7 +1988,6 @@ async def get_earnings_call_transcripts(data:TranscriptData): content = remove_text_before_operator(data['content']) chat = extract_names_and_descriptions(content) res = {'date': data['date'], 'chat': chat} - except: res = {} diff --git a/app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc b/app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc old mode 100755 new mode 100644 index ec1c98d..f538d97 Binary files a/app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc and b/app/ml_models/__pycache__/fundamental_predictor.cpython-310.pyc differ diff --git a/app/ml_models/__pycache__/prophet_model.cpython-310.pyc b/app/ml_models/__pycache__/prophet_model.cpython-310.pyc old mode 100755 new mode 100644 index 4b655e8..7fc825e Binary files a/app/ml_models/__pycache__/prophet_model.cpython-310.pyc and b/app/ml_models/__pycache__/prophet_model.cpython-310.pyc differ diff --git a/app/ml_models/fundamental_predictor.py b/app/ml_models/fundamental_predictor.py index 39530e3..07149f8 100755 --- a/app/ml_models/fundamental_predictor.py +++ b/app/ml_models/fundamental_predictor.py @@ -299,4 +299,4 @@ async def main(): con.close() # Run the main function -asyncio.run(main()) \ No newline at end of file +#asyncio.run(main()) \ No newline at end of file