Skip to content

Commit c553328

Browse files
authored
tqdmtldm (#141)
1 parent dac388f commit c553328

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ keywords = ynab, sqlite, sql, budget, cli
2020
packages = find:
2121
install_requires =
2222
aiohttp>=3
23-
tqdm>=4
23+
tldm
2424
python_requires = >=3.12
2525

2626
[options.entry_points]

sqlite_export_for_ynab/_main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from urllib.parse import urlunparse
2121

2222
import aiohttp
23-
from tqdm import tqdm
23+
from tldm import tldm
2424

2525
from sqlite_export_for_ynab import ddl
2626

@@ -125,7 +125,7 @@ async def sync(token: str, db: Path, full_refresh: bool) -> None:
125125
print("Fetching budget data...")
126126
lkos = get_last_knowledge_of_server(cur)
127127
async with aiohttp.ClientSession() as session:
128-
with tqdm(desc="Budget Data", total=len(budgets) * 5) as pbar:
128+
with tldm(desc="Budget Data", total=len(budgets) * 5) as pbar:
129129
yc = ProgressYnabClient(YnabClient(token, session), pbar)
130130

131131
account_jobs = jobs(yc, "accounts", budget_ids, lkos)
@@ -300,7 +300,7 @@ def insert_payees(
300300
if not payees:
301301
return
302302

303-
for payee in tqdm(payees, desc="Payees"):
303+
for payee in tldm(payees, desc="Payees"):
304304
insert_entry(cur, "payees", budget_id, payee)
305305

306306

@@ -411,7 +411,7 @@ def insert_nested_entries(
411411
if not entries:
412412
return
413413

414-
with tqdm(
414+
with tldm(
415415
total=sum(1 + len(e[subentries_name]) for e in entries),
416416
desc=desc,
417417
) as pbar:
@@ -471,7 +471,7 @@ async def __call__(
471471
@dataclass
472472
class ProgressYnabClient:
473473
yc: YnabClient
474-
pbar: tqdm[Never]
474+
pbar: tldm[Never]
475475

476476
async def __call__(
477477
self, path: str, last_knowledge_of_server: int | None = None

tests/_main_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import aiohttp
1111
import pytest
1212
from aiohttp.http_exceptions import HttpProcessingError
13-
from tqdm import tqdm
13+
from tldm import tldm
1414

1515
from sqlite_export_for_ynab import default_db_path
1616
from sqlite_export_for_ynab._main import _ALL_RELATIONS
@@ -412,7 +412,7 @@ async def test_progress_ynab_client_ok(mock_aioresponses):
412412
expected = {"example": [{"id": 1, "value": 2}, {"id": 3, "value": 4}]}
413413
mock_aioresponses.get(EXAMPLE_ENDPOINT_RE, body=json.dumps({"data": expected}))
414414

415-
with tqdm(disable=True) as pbar:
415+
with tldm(disable=True) as pbar:
416416
async with aiohttp.ClientSession(loop=asyncio.get_event_loop()) as session:
417417
pyc = ProgressYnabClient(YnabClient(TOKEN, session), pbar)
418418
entries = await pyc("example")

0 commit comments

Comments
 (0)