1818 import pandas as pd
1919
2020_MINUTE_UNITS : dict [str , int ] = {
21- "1m" : 1 , "3m" : 3 , "5m" : 5 , "10m" : 10 ,
22- "15m" : 15 , "30m" : 30 , "60m" : 60 , "240m" : 240 ,
21+ "1m" : 1 ,
22+ "3m" : 3 ,
23+ "5m" : 5 ,
24+ "10m" : 10 ,
25+ "15m" : 15 ,
26+ "30m" : 30 ,
27+ "60m" : 60 ,
28+ "240m" : 240 ,
2329}
2430
2531
@@ -43,27 +49,40 @@ def get_candles(
4349 with Upbeat () as client :
4450 if interval in _MINUTE_UNITS :
4551 return client .quotation .get_candles_minutes (
46- market = market , unit = _MINUTE_UNITS [interval ], to = to , count = count , # type: ignore[arg-type]
52+ market = market ,
53+ unit = _MINUTE_UNITS [interval ],
54+ to = to ,
55+ count = count , # type: ignore[arg-type]
4756 )
4857 if interval == "1s" :
4958 return client .quotation .get_candles_seconds (
50- market = market , to = to , count = count ,
59+ market = market ,
60+ to = to ,
61+ count = count ,
5162 )
5263 if interval == "1d" :
5364 return client .quotation .get_candles_days (
54- market = market , to = to , count = count ,
65+ market = market ,
66+ to = to ,
67+ count = count ,
5568 )
5669 if interval == "1w" :
5770 return client .quotation .get_candles_weeks (
58- market = market , to = to , count = count ,
71+ market = market ,
72+ to = to ,
73+ count = count ,
5974 )
6075 if interval == "1M" :
6176 return client .quotation .get_candles_months (
62- market = market , to = to , count = count ,
77+ market = market ,
78+ to = to ,
79+ count = count ,
6380 )
6481 if interval == "1y" :
6582 return client .quotation .get_candles_years (
66- market = market , to = to , count = count ,
83+ market = market ,
84+ to = to ,
85+ count = count ,
6786 )
6887 raise ValueError (
6988 f"Invalid interval: { interval !r} . "
@@ -81,27 +100,40 @@ def get_candles_df(
81100 with Upbeat () as client :
82101 if interval in _MINUTE_UNITS :
83102 return client .quotation .get_candles_minutes_df (
84- market = market , unit = _MINUTE_UNITS [interval ], to = to , count = count , # type: ignore[arg-type]
103+ market = market ,
104+ unit = _MINUTE_UNITS [interval ],
105+ to = to ,
106+ count = count , # type: ignore[arg-type]
85107 )
86108 if interval == "1s" :
87109 return client .quotation .get_candles_seconds_df (
88- market = market , to = to , count = count ,
110+ market = market ,
111+ to = to ,
112+ count = count ,
89113 )
90114 if interval == "1d" :
91115 return client .quotation .get_candles_days_df (
92- market = market , to = to , count = count ,
116+ market = market ,
117+ to = to ,
118+ count = count ,
93119 )
94120 if interval == "1w" :
95121 return client .quotation .get_candles_weeks_df (
96- market = market , to = to , count = count ,
122+ market = market ,
123+ to = to ,
124+ count = count ,
97125 )
98126 if interval == "1M" :
99127 return client .quotation .get_candles_months_df (
100- market = market , to = to , count = count ,
128+ market = market ,
129+ to = to ,
130+ count = count ,
101131 )
102132 if interval == "1y" :
103133 return client .quotation .get_candles_years_df (
104- market = market , to = to , count = count ,
134+ market = market ,
135+ to = to ,
136+ count = count ,
105137 )
106138 raise ValueError (
107139 f"Invalid interval: { interval !r} . "
@@ -129,7 +161,11 @@ def get_trades(
129161) -> list [Trade ]:
130162 with Upbeat () as client :
131163 return client .quotation .get_trades (
132- market , to = to , count = count , cursor = cursor , days_ago = days_ago ,
164+ market ,
165+ to = to ,
166+ count = count ,
167+ cursor = cursor ,
168+ days_ago = days_ago ,
133169 )
134170
135171
0 commit comments