Skip to content

Commit

Permalink
add logger to getleaderboardrank.py
Browse files Browse the repository at this point in the history
Signed-off-by: Bukowa <gitbukowa@gmail.com>
  • Loading branch information
bukowa committed Jan 25, 2024
1 parent 9a8b1ee commit 0e9c0a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion binance/getleaderboardrank.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import logging
from dataclasses import dataclass, asdict
from enum import Enum
from typing import Any
Expand All @@ -7,6 +8,8 @@

from common.common import save_json, load_json_default

logger = logging.getLogger(__name__)


@dataclass
class Trader:
Expand Down Expand Up @@ -111,7 +114,11 @@ def get_traders(*api: "API"):
traders = []
for a in api:
trade_type = a.requests_body[TradeType.key.value]
for each in a.requests_post().json()["data"]:
r = a.requests_post()
logger.debug(r.status_code)
rj = r.json()
logger.debug(rj.keys())
for each in rj["data"]:
each["tradeType"] = trade_type
traders.append(Trader(**each))
return traders
Expand Down Expand Up @@ -192,4 +199,5 @@ def requests_post(self, **kwargs):


if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
parse_all_traders(file="traders.json")

0 comments on commit 0e9c0a0

Please sign in to comment.