sqlite-export-for-ynab 2.9.0__tar.gz → 2.9.1__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 (25) hide show
  1. {sqlite_export_for_ynab-2.9.0/sqlite_export_for_ynab.egg-info → sqlite_export_for_ynab-2.9.1}/PKG-INFO +4 -10
  2. sqlite_export_for_ynab-2.9.1/pyproject.toml +133 -0
  3. sqlite_export_for_ynab-2.9.1/setup.cfg +4 -0
  4. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/_main.py +23 -25
  5. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1/sqlite_export_for_ynab.egg-info}/PKG-INFO +4 -10
  6. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab.egg-info/SOURCES.txt +0 -2
  7. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab.egg-info/requires.txt +0 -6
  8. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab.egg-info/top_level.txt +1 -0
  9. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/tests/_main_test.py +6 -8
  10. sqlite_export_for_ynab-2.9.0/pyproject.toml +0 -63
  11. sqlite_export_for_ynab-2.9.0/setup.cfg +0 -71
  12. sqlite_export_for_ynab-2.9.0/setup.py +0 -5
  13. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/LICENSE +0 -0
  14. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/README.md +0 -0
  15. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/__init__.py +0 -0
  16. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/__main__.py +0 -0
  17. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/ddl/__init__.py +0 -0
  18. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/ddl/create-relations.sql +0 -0
  19. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/ddl/drop-relations.sql +0 -0
  20. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab/py.typed +0 -0
  21. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab.egg-info/dependency_links.txt +0 -0
  22. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/sqlite_export_for_ynab.egg-info/entry_points.txt +0 -0
  23. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/testing/__init__.py +0 -0
  24. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/testing/fixtures.py +0 -0
  25. {sqlite_export_for_ynab-2.9.0 → sqlite_export_for_ynab-2.9.1}/tests/__init__.py +0 -0
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite_export_for_ynab
3
- Version: 2.9.0
3
+ Version: 2.9.1
4
4
  Summary: SQLite Export for YNAB - Export YNAB Data to SQLite
5
- Home-page: https://github.com/mxr/sqlite-export-for-ynab
6
- Author: Max R
7
- Author-email: maxr@outlook.com
8
- License: MIT
5
+ Author-email: Max R <mxr@users.noreply.github.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/mxr/sqlite-export-for-ynab
9
8
  Keywords: ynab,sqlite,sql,budget,plan,cli
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -21,11 +20,6 @@ Requires-Dist: asyncio-for-ynab~=1.84.0
21
20
  Requires-Dist: fasteners
22
21
  Requires-Dist: rich>=10
23
22
  Requires-Dist: tenacity
24
- Provides-Extra: dev
25
- Requires-Dist: covdefaults>=2.1.0; extra == "dev"
26
- Requires-Dist: coverage; extra == "dev"
27
- Requires-Dist: pytest; extra == "dev"
28
- Requires-Dist: pytest-asyncio; extra == "dev"
29
23
  Dynamic: license-file
30
24
 
31
25
  # sqlite-export-for-ynab
@@ -0,0 +1,133 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = ["setuptools"]
4
+
5
+ [dependency-groups]
6
+ dev = [
7
+ "covdefaults>=2.1.0",
8
+ "coverage",
9
+ "pytest",
10
+ "pytest-asyncio",
11
+ ]
12
+
13
+ [project]
14
+ authors = [{name = "Max R", email = "mxr@users.noreply.github.com"}]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: Implementation :: CPython",
19
+ "Programming Language :: Python :: Implementation :: PyPy",
20
+ ]
21
+ dependencies = [
22
+ "aiohttp>=3",
23
+ "aiopathlib",
24
+ "aiosqlite",
25
+ "asyncio-for-ynab~=1.84.0",
26
+ "fasteners",
27
+ "rich>=10",
28
+ "tenacity",
29
+ ]
30
+ description = "SQLite Export for YNAB - Export YNAB Data to SQLite"
31
+ keywords = ["ynab", "sqlite", "sql", "budget", "plan", "cli"]
32
+ license = "MIT"
33
+ license-files = ["LICENSE"]
34
+ name = "sqlite_export_for_ynab"
35
+ readme = "README.md"
36
+ requires-python = ">=3.12"
37
+ version = "2.9.1"
38
+
39
+ [project.scripts]
40
+ sqlite-export-for-ynab = "sqlite_export_for_ynab._main:main"
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/mxr/sqlite-export-for-ynab"
44
+
45
+ [tool.coverage.run]
46
+ plugins = ["covdefaults"]
47
+
48
+ [tool.mypy]
49
+ check_untyped_defs = true
50
+ disallow_any_generics = true
51
+ disallow_incomplete_defs = true
52
+ disallow_untyped_defs = true
53
+ warn_redundant_casts = true
54
+ warn_unused_ignores = true
55
+
56
+ [[tool.mypy.overrides]]
57
+ disallow_untyped_defs = false
58
+ module = "testing.*"
59
+
60
+ [[tool.mypy.overrides]]
61
+ disallow_untyped_defs = false
62
+ module = "tests.*"
63
+
64
+ [tool.pytest.ini_options]
65
+ asyncio_default_fixture_loop_scope = "function"
66
+
67
+ [tool.ruff]
68
+ target-version = "py312"
69
+
70
+ [tool.ruff.lint]
71
+ extend-select = [
72
+ "UP", # see pyupgrade
73
+ "B", # see flake8-bugbear
74
+ "A", # see flake8-builtins
75
+ "C4", # see flake8-comprehension
76
+ "SIM", # see flake8-simplify
77
+ "TC", # see flake8-type-checking
78
+ ]
79
+
80
+ [tool.setuptools.package-data]
81
+ "*" = ["*.sql"]
82
+ sqlite_export_for_ynab = ["py.typed"]
83
+
84
+ [tool.setuptools.packages]
85
+ find = {}
86
+
87
+ [tool.sqlfluff.layout.type.comma]
88
+ line_position = "leading"
89
+ spacing_before = "touch"
90
+
91
+ [tool.sqlfluff.layout.type.from_clause]
92
+ keyword_line_position = "leading"
93
+
94
+ [tool.sqlfluff.layout.type.when_clause]
95
+ keyword_line_position = "leading"
96
+
97
+ [tool.sqlfluff.rules.capitalisation.functions]
98
+ extended_capitalisation_policy = 'upper'
99
+
100
+ [tool.sqlfluff.rules.capitalisation.identifiers]
101
+ extended_capitalisation_policy = 'lower'
102
+
103
+ [tool.sqlfluff.rules.capitalisation.keywords]
104
+ capitalisation_policy = 'upper'
105
+
106
+ [tool.sqlfluff.rules.capitalisation.literals]
107
+ capitalisation_policy = 'upper'
108
+
109
+ [tool.sqlfluff.rules.convention.not_equal]
110
+ preferred_not_equal_style = "c_style"
111
+
112
+ [tool.sqlfluff.rules.convention.terminator]
113
+ multiline_newline = true
114
+ require_final_semicolon = true
115
+
116
+ [tool.sqlfluff.rules.references.quoting]
117
+ prefer_quoted_keywords = true
118
+
119
+ [tool.tox]
120
+ env_list = ["py", "pypy3", "pre-commit"]
121
+
122
+ [tool.tox.env.pre-commit]
123
+ commands = [["pre-commit", "run", "--all-files", "--show-diff-on-failure"]]
124
+ deps = ["pre-commit-uv"]
125
+ skip_install = true
126
+
127
+ [tool.tox.env_run_base]
128
+ commands = [
129
+ ["coverage", "erase"],
130
+ ["coverage", "run", "-m", "pytest", "{posargs:tests}"],
131
+ ["coverage", "report"],
132
+ ]
133
+ dependency_groups = ["dev"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -307,7 +307,7 @@ async def sync(
307
307
 
308
308
 
309
309
  async def contents(filename: str) -> str:
310
- return await AsyncPath(resources.files(ddl) / filename).read_text()
310
+ return await AsyncPath(str(resources.files(ddl) / filename)).read_text()
311
311
 
312
312
 
313
313
  async def get_relations(cur: aiosqlite.Cursor) -> set[str]:
@@ -642,17 +642,13 @@ async def _get_all_ynab(
642
642
  async def _get_plan_data(
643
643
  context: _Context, plan_id: str, lkos: dict[str, int], task_id: TaskID
644
644
  ) -> tuple[str, _YnabPlanData]:
645
+ py = _ProgressYnab(context, plan_id, lkos, task_id)
645
646
  accounts, categories, payees, transactions, scheduled = await asyncio.gather(
646
- *(
647
- _get_ynab(context, endpoint, plan_id, lkos, task_id)
648
- for endpoint in (
649
- AccountsApi(context.api_client).get_accounts,
650
- CategoriesApi(context.api_client).get_categories,
651
- PayeesApi(context.api_client).get_payees,
652
- TransactionsApi(context.api_client).get_transactions,
653
- ScheduledTransactionsApi(context.api_client).get_scheduled_transactions,
654
- )
655
- )
647
+ py.get(AccountsApi(context.api_client).get_accounts),
648
+ py.get(CategoriesApi(context.api_client).get_categories),
649
+ py.get(PayeesApi(context.api_client).get_payees),
650
+ py.get(TransactionsApi(context.api_client).get_transactions),
651
+ py.get(ScheduledTransactionsApi(context.api_client).get_scheduled_transactions),
656
652
  )
657
653
  return (
658
654
  plan_id,
@@ -667,20 +663,22 @@ async def _get_plan_data(
667
663
  )
668
664
 
669
665
 
670
- @retry(stop=stop_after_attempt(3))
671
- async def _get_ynab[T](
672
- context: _Context,
673
- endpoint: Callable[..., Awaitable[T]],
674
- plan_id: str,
675
- lkos: dict[str, int],
676
- task_id: TaskID,
677
- ) -> T:
678
- try:
679
- return await endpoint(
680
- plan_id=plan_id, last_knowledge_of_server=lkos.get(plan_id)
681
- )
682
- finally:
683
- context.progress.update(task_id, advance=1)
666
+ @dataclass(slots=True)
667
+ class _ProgressYnab:
668
+ context: _Context
669
+ plan_id: str
670
+ lkos: dict[str, int]
671
+ task_id: TaskID
672
+
673
+ @retry(stop=stop_after_attempt(3))
674
+ async def get[T](self, endpoint: Callable[..., Awaitable[T]]) -> T:
675
+ try:
676
+ return await endpoint(
677
+ plan_id=self.plan_id,
678
+ last_knowledge_of_server=self.lkos.get(self.plan_id),
679
+ )
680
+ finally:
681
+ self.context.progress.update(self.task_id, advance=1)
684
682
 
685
683
 
686
684
  def main(
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite_export_for_ynab
3
- Version: 2.9.0
3
+ Version: 2.9.1
4
4
  Summary: SQLite Export for YNAB - Export YNAB Data to SQLite
5
- Home-page: https://github.com/mxr/sqlite-export-for-ynab
6
- Author: Max R
7
- Author-email: maxr@outlook.com
8
- License: MIT
5
+ Author-email: Max R <mxr@users.noreply.github.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/mxr/sqlite-export-for-ynab
9
8
  Keywords: ynab,sqlite,sql,budget,plan,cli
10
9
  Classifier: Programming Language :: Python :: 3
11
10
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -21,11 +20,6 @@ Requires-Dist: asyncio-for-ynab~=1.84.0
21
20
  Requires-Dist: fasteners
22
21
  Requires-Dist: rich>=10
23
22
  Requires-Dist: tenacity
24
- Provides-Extra: dev
25
- Requires-Dist: covdefaults>=2.1.0; extra == "dev"
26
- Requires-Dist: coverage; extra == "dev"
27
- Requires-Dist: pytest; extra == "dev"
28
- Requires-Dist: pytest-asyncio; extra == "dev"
29
23
  Dynamic: license-file
30
24
 
31
25
  # sqlite-export-for-ynab
@@ -1,8 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
- setup.cfg
5
- setup.py
6
4
  sqlite_export_for_ynab/__init__.py
7
5
  sqlite_export_for_ynab/__main__.py
8
6
  sqlite_export_for_ynab/_main.py
@@ -5,9 +5,3 @@ asyncio-for-ynab~=1.84.0
5
5
  fasteners
6
6
  rich>=10
7
7
  tenacity
8
-
9
- [dev]
10
- covdefaults>=2.1.0
11
- coverage
12
- pytest
13
- pytest-asyncio
@@ -1,9 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
- from configparser import ConfigParser
3
+ import tomllib
4
4
  from pathlib import Path
5
- from typing import Any
6
- from typing import cast
7
5
  from unittest.mock import AsyncMock
8
6
  from unittest.mock import Mock
9
7
  from unittest.mock import patch
@@ -454,7 +452,7 @@ async def test_insert_category_group_without_categories(context):
454
452
  await insert_category_groups(
455
453
  context,
456
454
  PLAN_ID_1,
457
- cast("Any", [CATEGORY_GROUPS[0].model_copy(update={"categories": []})]),
455
+ [CATEGORY_GROUPS[0].model_copy(update={"categories": []})],
458
456
  )
459
457
 
460
458
  assert_rows(
@@ -860,7 +858,7 @@ async def test_insert_scheduled_transactions(context):
860
858
  )
861
859
  @pytest.mark.asyncio
862
860
  async def test_get_plan_summaries_retries():
863
- assert await _get_plan_summaries(object()) == PLANS
861
+ assert await _get_plan_summaries(Mock(spec=asyncio_for_ynab.ApiClient)) == PLANS
864
862
 
865
863
 
866
864
  @patch("sqlite_export_for_ynab._main.sync")
@@ -877,9 +875,9 @@ async def test_async_main_parses_full_refresh_and_quiet(sync, tmp_path, monkeypa
877
875
 
878
876
 
879
877
  def test_main_version(capsys):
880
- cp = ConfigParser()
881
- cp.read(Path(__file__).parent.parent / "setup.cfg")
882
- expected_version = cp["metadata"]["version"]
878
+ with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as f:
879
+ data = tomllib.load(f)
880
+ expected_version = data["project"]["version"]
883
881
 
884
882
  with pytest.raises(SystemExit) as excinfo:
885
883
  main(("--version",))
@@ -1,63 +0,0 @@
1
- [tool.mypy]
2
- check_untyped_defs = true
3
- disallow_any_generics = true
4
- disallow_incomplete_defs = true
5
- disallow_untyped_defs = true
6
- warn_redundant_casts = true
7
- warn_unused_ignores = true
8
-
9
- [[tool.mypy.overrides]]
10
- disallow_untyped_defs = false
11
- module = "testing.*"
12
-
13
- [[tool.mypy.overrides]]
14
- disallow_untyped_defs = false
15
- module = "tests.*"
16
-
17
- [tool.pytest.ini_options]
18
- asyncio_default_fixture_loop_scope = "function"
19
-
20
- [tool.ruff]
21
- target-version = "py312"
22
-
23
- [tool.ruff.lint]
24
- extend-select = [
25
- "UP", # see pyupgrade
26
- "B", # see flake8-bugbear
27
- "A", # see flake8-builtins
28
- "C4", # see flake8-comprehension
29
- "SIM", # see flake8-simplify
30
- "TC", # see flake8-type-checking
31
- ]
32
-
33
- [tool.sqlfluff.layout.type.comma]
34
- line_position = "leading"
35
- spacing_before = "touch"
36
-
37
- [tool.sqlfluff.layout.type.from_clause]
38
- keyword_line_position = "leading"
39
-
40
- [tool.sqlfluff.layout.type.when_clause]
41
- keyword_line_position = "leading"
42
-
43
- [tool.sqlfluff.rules.capitalisation.functions]
44
- extended_capitalisation_policy = 'upper'
45
-
46
- [tool.sqlfluff.rules.capitalisation.identifiers]
47
- extended_capitalisation_policy = 'lower'
48
-
49
- [tool.sqlfluff.rules.capitalisation.keywords]
50
- capitalisation_policy = 'upper'
51
-
52
- [tool.sqlfluff.rules.capitalisation.literals]
53
- capitalisation_policy = 'upper'
54
-
55
- [tool.sqlfluff.rules.convention.not_equal]
56
- preferred_not_equal_style = "c_style"
57
-
58
- [tool.sqlfluff.rules.convention.terminator]
59
- multiline_newline = true
60
- require_final_semicolon = true
61
-
62
- [tool.sqlfluff.rules.references.quoting]
63
- prefer_quoted_keywords = true
@@ -1,71 +0,0 @@
1
- [metadata]
2
- name = sqlite_export_for_ynab
3
- version = 2.9.0
4
- description = SQLite Export for YNAB - Export YNAB Data to SQLite
5
- long_description = file: README.md
6
- long_description_content_type = text/markdown
7
- url = https://github.com/mxr/sqlite-export-for-ynab
8
- author = Max R
9
- author_email = maxr@outlook.com
10
- license = MIT
11
- license_files = LICENSE
12
- classifiers =
13
- Programming Language :: Python :: 3
14
- Programming Language :: Python :: 3 :: Only
15
- Programming Language :: Python :: Implementation :: CPython
16
- Programming Language :: Python :: Implementation :: PyPy
17
- keywords = ynab, sqlite, sql, budget, plan, cli
18
-
19
- [options]
20
- packages = find:
21
- install_requires =
22
- aiohttp>=3
23
- aiopathlib
24
- aiosqlite
25
- asyncio-for-ynab~=1.84.0
26
- fasteners
27
- rich>=10
28
- tenacity
29
- python_requires = >=3.12
30
-
31
- [options.entry_points]
32
- console_scripts =
33
- sqlite-export-for-ynab = sqlite_export_for_ynab._main:main
34
-
35
- [options.extras_require]
36
- dev =
37
- covdefaults>=2.1.0
38
- coverage
39
- pytest
40
- pytest-asyncio
41
-
42
- [options.package_data]
43
- * = *.sql
44
- sqlite_export_for_ynab =
45
- py.typed
46
-
47
- [bdist_wheel]
48
- universal = True
49
-
50
- [coverage:run]
51
- plugins = covdefaults
52
-
53
- [tox:tox]
54
- envlist = py,pypy3,pre-commit
55
-
56
- [testenv]
57
- extras = dev
58
- commands =
59
- coverage erase
60
- coverage run -m pytest {posargs:tests}
61
- coverage report
62
-
63
- [testenv:pre-commit]
64
- skip_install = true
65
- deps = pre-commit-uv
66
- commands = pre-commit run --all-files --show-diff-on-failure
67
-
68
- [egg_info]
69
- tag_build =
70
- tag_date = 0
71
-
@@ -1,5 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from setuptools import setup
4
-
5
- setup()