Skip to content

Commit 4ca697e

Browse files
committed
feat(automations): add progress bar, update deps
1 parent 8377d13 commit 4ca697e

File tree

3 files changed

+112
-87
lines changed

3 files changed

+112
-87
lines changed

automations/feed_table_generator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import requests
88
from pycoingecko import CoinGeckoAPI
9+
from tqdm import tqdm
910
from web3 import Web3
1011

1112
# Configuration
@@ -30,7 +31,7 @@
3031
"name": "Hex Trust USD",
3132
"decimals": 5,
3233
"category": "Crypto",
33-
}
34+
},
3435
}
3536

3637

@@ -92,9 +93,9 @@ def get_coins_list(num_pages: int) -> list[dict]:
9293
coins = []
9394
logger.info("Querying %i pages on CoinGecko...", num_pages)
9495
try:
95-
for page in range(1, num_pages + 1):
96+
for page in tqdm(range(1, num_pages + 1)):
9697
coins += cg.get_coins_markets(vs_currency="usd", per_page=250, page=page)
97-
time.sleep(0.5)
98+
time.sleep(1)
9899
except Exception:
99100
logger.exception("Error fetching coins from CoinGecko")
100101
sys.exit(1)

automations/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
88
"pycoingecko>=3.1.0",
9+
"tqdm>=4.67.1",
910
"web3>=7.2.0",
1011
]
1112

0 commit comments

Comments
 (0)