Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ keywords = ynab, sqlite, sql, budget, cli
packages = find:
install_requires =
aiohttp>=3
tqdm>=4
tldm
python_requires = >=3.12

[options.entry_points]
Expand Down
10 changes: 5 additions & 5 deletions sqlite_export_for_ynab/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from urllib.parse import urlunparse

import aiohttp
from tqdm import tqdm
from tldm import tldm

from sqlite_export_for_ynab import ddl

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

account_jobs = jobs(yc, "accounts", budget_ids, lkos)
Expand Down Expand Up @@ -300,7 +300,7 @@ def insert_payees(
if not payees:
return

for payee in tqdm(payees, desc="Payees"):
for payee in tldm(payees, desc="Payees"):
insert_entry(cur, "payees", budget_id, payee)


Expand Down Expand Up @@ -411,7 +411,7 @@ def insert_nested_entries(
if not entries:
return

with tqdm(
with tldm(
total=sum(1 + len(e[subentries_name]) for e in entries),
desc=desc,
) as pbar:
Expand Down Expand Up @@ -471,7 +471,7 @@ async def __call__(
@dataclass
class ProgressYnabClient:
yc: YnabClient
pbar: tqdm[Never]
pbar: tldm[Never]

async def __call__(
self, path: str, last_knowledge_of_server: int | None = None
Expand Down
4 changes: 2 additions & 2 deletions tests/_main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import aiohttp
import pytest
from aiohttp.http_exceptions import HttpProcessingError
from tqdm import tqdm
from tldm import tldm

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

with tqdm(disable=True) as pbar:
with tldm(disable=True) as pbar:
async with aiohttp.ClientSession(loop=asyncio.get_event_loop()) as session:
pyc = ProgressYnabClient(YnabClient(TOKEN, session), pbar)
entries = await pyc("example")
Expand Down