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.
- {sqlite_export_for_ynab-2.9.5/sqlite_export_for_ynab.egg-info → sqlite_export_for_ynab-2.9.6}/PKG-INFO +1 -1
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/pyproject.toml +8 -3
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/_main.py +29 -39
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6/sqlite_export_for_ynab.egg-info}/PKG-INFO +1 -1
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/testing/fixtures.py +0 -1
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/LICENSE +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/README.md +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/setup.cfg +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/__init__.py +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/__main__.py +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/__init__.py +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/create-relations.sql +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/drop-relations.sql +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/py.typed +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/SOURCES.txt +0 -0
- {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
- {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
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab.egg-info/requires.txt +0 -0
- {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
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/testing/__init__.py +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/tests/__init__.py +0 -0
- {sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/tests/_main_test.py +9 -9
|
@@ -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.
|
|
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"]
|
{sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/_main.py
RENAMED
|
@@ -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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_Endpoint =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
+
|
|
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[
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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 =
|
|
706
|
+
today = datetime.now().astimezone().date()
|
|
717
707
|
responses = await asyncio.gather(
|
|
718
708
|
*(
|
|
719
709
|
self._chunk(transactions_api, plan_id, sd, ud)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/__init__.py
RENAMED
|
File without changes
|
{sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/__main__.py
RENAMED
|
File without changes
|
{sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/ddl/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sqlite_export_for_ynab-2.9.5 → sqlite_export_for_ynab-2.9.6}/sqlite_export_for_ynab/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
|