sqlite-export-for-ynab 2.9.5__tar.gz → 2.9.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {sqlite_export_for_ynab-2.9.5/sqlite_export_for_ynab.egg-info → sqlite_export_for_ynab-2.9.6}/PKG-INFO +1 -1
  2. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/pyproject.toml +8 -3
  3. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/_main.py +29 -39
  4. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6/sqlite_export_for_ynab.egg-info}/PKG-INFO +1 -1
  5. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/testing/fixtures.py +0 -1
  6. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/LICENSE +0 -0
  7. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/README.md +0 -0
  8. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/setup.cfg +0 -0
  9. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/__init__.py +0 -0
  10. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/__main__.py +0 -0
  11. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/__init__.py +0 -0
  12. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/create-relations.sql +0 -0
  13. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/drop-relations.sql +0 -0
  14. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/py.typed +0 -0
  15. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/SOURCES.txt +0 -0
  16. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/dependency_links.txt +0 -0
  17. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/entry_points.txt +0 -0
  18. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/requires.txt +0 -0
  19. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/top_level.txt +0 -0
  20. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/testing/__init__.py +0 -0
  21. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/tests/__init__.py +0 -0
  22. {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/tests/_main_test.py +9 -9
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite_export_for_ynab
3
- Version: 2.9.5
3
+ Version: 2.9.6
4
4
  Summary: SQLite Export for YNAB - Export YNAB Data to SQLite
5
5
  Author-email: Max R <mxr@users.noreply.github.com>
6
6
  License-Expression: MIT
@@ -34,7 +34,7 @@ license-files = ["LICENSE"]
34
34
  name = "sqlite_export_for_ynab"
35
35
  readme = "README.md"
36
36
  requires-python = ">=3.12"
37
- version = "2.9.5"
37
+ version = "2.9.6"
38
38
 
39
39
  [project.scripts]
40
40
  sqlite-export-for-ynab = "sqlite_export_for_ynab._main:main"
@@ -69,14 +69,19 @@ target-version = "py312"
69
69
 
70
70
  [tool.ruff.lint]
71
71
  extend-select = [
72
- "UP", # see pyupgrade
73
- "B", # see flake8-bugbear
74
72
  "A", # see flake8-builtins
73
+ "B", # see flake8-bugbear
75
74
  "C4", # see flake8-comprehension
75
+ "I", # sort imports
76
76
  "SIM", # see flake8-simplify
77
77
  "TC", # see flake8-type-checking
78
+ "UP", # see pyupgrade
78
79
  ]
79
80
 
81
+ [tool.ruff.lint.isort]
82
+ force-single-line = true
83
+ required-imports = ["from __future__ import annotations"]
84
+
80
85
  [tool.setuptools.package-data]
81
86
  sqlite_export_for_ynab = ["py.typed"]
82
87
  "sqlite_export_for_ynab.ddl" = ["*.sql"]
@@ -8,16 +8,18 @@ from contextlib import contextmanager
8
8
  from dataclasses import dataclass
9
9
  from dataclasses import fields
10
10
  from datetime import date
11
+ from datetime import datetime
11
12
  from datetime import timedelta
12
13
  from importlib import resources
13
14
  from importlib.metadata import version
14
15
  from itertools import batched
15
16
  from pathlib import Path
17
+ from typing import TYPE_CHECKING
16
18
  from typing import Any
17
19
  from typing import Literal
20
+ from typing import get_args
18
21
  from typing import overload
19
22
  from typing import override
20
- from typing import TYPE_CHECKING
21
23
 
22
24
  import aiosqlite
23
25
  import asyncio_for_ynab # noqa: F401
@@ -84,28 +86,24 @@ except ImportError: # pragma: no cover
84
86
  )
85
87
 
86
88
 
87
- _EntryTable = (
88
- Literal["accounts"]
89
- | Literal["account_periodic_values"]
90
- | Literal["category_groups"]
91
- | Literal["categories"]
92
- | Literal["payees"]
93
- | Literal["transactions"]
94
- | Literal["subtransactions"]
95
- | Literal["scheduled_transactions"]
96
- | Literal["scheduled_subtransactions"]
97
- )
98
- _Endpoint = (
99
- Literal["accounts"]
100
- | Literal["categories"]
101
- | Literal["payees"]
102
- | Literal["transactions"]
103
- | Literal["scheduled_transactions"]
104
- )
105
- _ENDPOINTS = tuple(lit.__args__[0] for lit in _Endpoint.__args__)
89
+ _EntryTable = Literal[
90
+ "accounts",
91
+ "account_periodic_values",
92
+ "category_groups",
93
+ "categories",
94
+ "payees",
95
+ "transactions",
96
+ "subtransactions",
97
+ "scheduled_transactions",
98
+ "scheduled_subtransactions",
99
+ ]
100
+ _Endpoint = Literal[
101
+ "accounts", "categories", "payees", "transactions", "scheduled_transactions"
102
+ ]
103
+ _ENDPOINTS = get_args(_Endpoint)
106
104
  _ALL_RELATIONS = frozenset(
107
105
  ("plans", "flat_transactions", "scheduled_flat_transactions")
108
- + tuple(lit.__args__[0] for lit in _EntryTable.__args__)
106
+ + get_args(_EntryTable)
109
107
  )
110
108
 
111
109
  _ENV_TOKEN = "YNAB_PERSONAL_ACCESS_TOKEN"
@@ -556,28 +554,20 @@ async def insert_nested_entries(
556
554
  context: _Context,
557
555
  plan_id: str,
558
556
  entries: list[dict[str, Any]],
559
- desc: (
560
- Literal["Accounts"]
561
- | Literal["Categories"]
562
- | Literal["Transactions"]
563
- | Literal["Scheduled Transactions"]
564
- ),
557
+ desc: (Literal["Accounts", "Categories", "Transactions", "Scheduled Transactions"]),
565
558
  entries_name: (
566
- Literal["accounts"]
567
- | Literal["category_groups"]
568
- | Literal["transactions"]
569
- | Literal["scheduled_transactions"]
559
+ Literal["accounts", "category_groups", "transactions", "scheduled_transactions"]
570
560
  ),
571
561
  subentries_name: (
572
- Literal["account_periodic_values"]
573
- | Literal["categories"]
574
- | Literal["subtransactions"]
562
+ Literal["account_periodic_values", "categories", "subtransactions"]
575
563
  ),
576
564
  subentries_table_name: (
577
- Literal["account_periodic_values"]
578
- | Literal["categories"]
579
- | Literal["subtransactions"]
580
- | Literal["scheduled_subtransactions"]
565
+ Literal[
566
+ "account_periodic_values",
567
+ "categories",
568
+ "subtransactions",
569
+ "scheduled_subtransactions",
570
+ ]
581
571
  ),
582
572
  ) -> None:
583
573
  if not entries:
@@ -713,7 +703,7 @@ class ChunkedTransactionsApi:
713
703
  async def _get(
714
704
  self, transactions_api: TransactionsApi, plan_id: str
715
705
  ) -> TransactionsResponse:
716
- today = date.today()
706
+ today = datetime.now().astimezone().date()
717
707
  responses = await asyncio.gather(
718
708
  *(
719
709
  self._chunk(transactions_api, plan_id, sd, ud)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite_export_for_ynab
3
- Version: 2.9.5
3
+ Version: 2.9.6
4
4
  Summary: SQLite Export for YNAB - Export YNAB Data to SQLite
5
5
  Author-email: Max R <mxr@users.noreply.github.com>
6
6
  License-Expression: MIT
@@ -29,7 +29,6 @@ from asyncio_for_ynab import TransactionDetail
29
29
  from asyncio_for_ynab import TransactionsResponse
30
30
  from asyncio_for_ynab import TransactionsResponseData
31
31
 
32
-
33
32
  PLAN_ID_1 = str(uuid4())
34
33
  PLAN_ID_2 = str(uuid4())
35
34
 
@@ -15,16 +15,16 @@ from rich.progress import Progress
15
15
 
16
16
  from sqlite_export_for_ynab import default_db_path
17
17
  from sqlite_export_for_ynab._main import _ALL_RELATIONS
18
- from sqlite_export_for_ynab._main import _Context
19
- from sqlite_export_for_ynab._main import _context
20
18
  from sqlite_export_for_ynab._main import _ENV_TOKEN
21
- from sqlite_export_for_ynab._main import _get_plan_summaries
22
19
  from sqlite_export_for_ynab._main import _PACKAGE
23
20
  from sqlite_export_for_ynab._main import _PROGRESS_COLUMNS
21
+ from sqlite_export_for_ynab._main import ChunkedTransactionsApi
22
+ from sqlite_export_for_ynab._main import _Context
23
+ from sqlite_export_for_ynab._main import _context
24
+ from sqlite_export_for_ynab._main import _get_plan_summaries
24
25
  from sqlite_export_for_ynab._main import _quarterly
25
26
  from sqlite_export_for_ynab._main import async_main
26
27
  from sqlite_export_for_ynab._main import asyncio_for_ynab
27
- from sqlite_export_for_ynab._main import ChunkedTransactionsApi
28
28
  from sqlite_export_for_ynab._main import contents
29
29
  from sqlite_export_for_ynab._main import get_last_knowledge_of_server
30
30
  from sqlite_export_for_ynab._main import get_relations
@@ -41,8 +41,6 @@ from sqlite_export_for_ynab._main import sync
41
41
  from testing.fixtures import ACCOUNT_ID_1
42
42
  from testing.fixtures import ACCOUNT_ID_2
43
43
  from testing.fixtures import ACCOUNTS
44
- from testing.fixtures import accounts_response
45
- from testing.fixtures import categories_response
46
44
  from testing.fixtures import CATEGORY_GOAL_TARGET_DATE_1
47
45
  from testing.fixtures import CATEGORY_GROUP_ID_1
48
46
  from testing.fixtures import CATEGORY_GROUP_ID_2
@@ -61,10 +59,8 @@ from testing.fixtures import LKOS
61
59
  from testing.fixtures import PAYEE_ID_1
62
60
  from testing.fixtures import PAYEE_ID_2
63
61
  from testing.fixtures import PAYEES
64
- from testing.fixtures import payees_response
65
62
  from testing.fixtures import PLAN_ID_1
66
63
  from testing.fixtures import PLAN_ID_2
67
- from testing.fixtures import plan_response
68
64
  from testing.fixtures import PLANS
69
65
  from testing.fixtures import SCHEDULED_SUBTRANSACTION_ID_1
70
66
  from testing.fixtures import SCHEDULED_SUBTRANSACTION_ID_2
@@ -72,7 +68,6 @@ from testing.fixtures import SCHEDULED_TRANSACTION_ID_1
72
68
  from testing.fixtures import SCHEDULED_TRANSACTION_ID_2
73
69
  from testing.fixtures import SCHEDULED_TRANSACTION_ID_3
74
70
  from testing.fixtures import SCHEDULED_TRANSACTIONS
75
- from testing.fixtures import scheduled_transactions_response
76
71
  from testing.fixtures import SERVER_KNOWLEDGE_1
77
72
  from testing.fixtures import SERVER_KNOWLEDGE_2
78
73
  from testing.fixtures import SUBTRANSACTION_ID_1
@@ -83,6 +78,11 @@ from testing.fixtures import TRANSACTION_ID_1
83
78
  from testing.fixtures import TRANSACTION_ID_2
84
79
  from testing.fixtures import TRANSACTION_ID_3
85
80
  from testing.fixtures import TRANSACTIONS
81
+ from testing.fixtures import accounts_response
82
+ from testing.fixtures import categories_response
83
+ from testing.fixtures import payees_response
84
+ from testing.fixtures import plan_response
85
+ from testing.fixtures import scheduled_transactions_response
86
86
  from testing.fixtures import transactions_response
87
87
 
88
88