Skip to content

Commit

Permalink
Apply Code Formatter Change
Browse files Browse the repository at this point in the history
  • Loading branch information
aoki-h-jp authored and github-actions[bot] committed Jan 2, 2024
1 parent 2793d28 commit 31d134b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bybit_bulk_downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BybitBulkDownloader:
"""
Bulk downloader for Bybit data.
"""

_CHUNK_SIZE = 20
_BYBIT_DATA_DOWNLOAD_BASE_URL = "https://public.bybit.com"
_DATA_TYPE = (
Expand Down Expand Up @@ -269,9 +270,9 @@ def __convert_to_int_interval(interval: str) -> int:
elif interval == "D":
return 1440
elif interval == "W":
return 1440*7
return 1440 * 7
elif interval == "M":
return 1440*30
return 1440 * 30
else:
raise ValueError("Invalid interval")

Expand All @@ -293,7 +294,8 @@ def __download(start_time: datetime):
interval=interval,
limit=1000,
startTime=int(start_time.timestamp()) * 1000,
endTime=start_time + timedelta(minutes=__convert_to_int_interval(interval) * 1000),
endTime=start_time
+ timedelta(minutes=__convert_to_int_interval(interval) * 1000),
)["result"]["list"]:
df_tmp.loc[len(df_tmp)] = d

Expand Down Expand Up @@ -329,7 +331,9 @@ def __download(start_time: datetime):
start_date = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S").date()

for start_time_chunk in self.make_chunks(
self.generate_dates_by_minutes_limited(start_date, __convert_to_int_interval(interval) * 1000),
self.generate_dates_by_minutes_limited(
start_date, __convert_to_int_interval(interval) * 1000
),
self._CHUNK_SIZE,
):
print(f"[bold blue]Downloading: {symbol}[/bold blue]")
Expand Down

0 comments on commit 31d134b

Please sign in to comment.