From c0646ed0211ce0c5ad7da26b720b70546bc812fa Mon Sep 17 00:00:00 2001 From: moshferatu Date: Sat, 30 Mar 2024 06:20:14 -0700 Subject: [PATCH] More trivial formatting changes --- iqfeed/iqfeed.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iqfeed/iqfeed.py b/iqfeed/iqfeed.py index 8be36ea..b586dcc 100644 --- a/iqfeed/iqfeed.py +++ b/iqfeed/iqfeed.py @@ -8,7 +8,7 @@ from os import getenv load_dotenv() -def read_data_from_socket(sock, recv_buffer=4096): +def read_data_from_socket(sock, recv_buffer = 4096): buffer = b'' data = b'' while True: @@ -24,8 +24,8 @@ def read_data_from_socket(sock, recv_buffer=4096): def _get_daily_data(symbol: str, max_days: int) -> pd.DataFrame: message = 'HDX,{symbol},{max_days},1\n'.format( - symbol=symbol, - max_days=max_days + symbol = symbol, + max_days = max_days ) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -40,7 +40,7 @@ def _get_daily_data(symbol: str, max_days: int) -> pd.DataFrame: data = data.replace(',\n','\n')[:-1] data = StringIO(data) - return pd.read_csv(data, index_col=False, + return pd.read_csv(data, index_col = False, names=['Date', 'High', 'Low', 'Open', 'Close', 'Total Volume', 'Period Volume']) def get_daily_data(symbol: str, start_date: datetime, end_date: datetime) -> pd.DataFrame: @@ -51,7 +51,7 @@ def get_daily_data(symbol: str, start_date: datetime, end_date: datetime) -> pd. data['Date'] = pd.to_datetime(data['Date']) data['Date'] = data['Date'].dt.date data = data[(data['Date'] >= start_date.date()) & (data['Date'] <= end_date.date())] - data = data.reset_index(drop=True) + data = data.reset_index(drop = True) return data def seconds(value):