More trivial formatting changes

This commit is contained in:
moshferatu 2024-03-30 06:20:14 -07:00
parent f7f10a1003
commit c0646ed021

View File

@ -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):