sqlite-export-for-ynab 2.2.0__tar.gz → 2.3.0__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 (23) hide show
  1. {sqlite_export_for_ynab-2.2.0/sqlite_export_for_ynab.egg-info → sqlite_export_for_ynab-2.3.0}/PKG-INFO +3 -2
  2. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/README.md +2 -1
  3. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/setup.cfg +1 -1
  4. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/ddl/create-relations.sql +1 -1
  5. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0/sqlite_export_for_ynab.egg-info}/PKG-INFO +3 -2
  6. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/testing/fixtures.py +3 -0
  7. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/tests/_main_test.py +3 -13
  8. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/LICENSE +0 -0
  9. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/pyproject.toml +0 -0
  10. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/setup.py +0 -0
  11. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/__init__.py +0 -0
  12. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/__main__.py +0 -0
  13. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/_main.py +0 -0
  14. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/ddl/__init__.py +0 -0
  15. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/ddl/drop-relations.sql +0 -0
  16. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab/py.typed +0 -0
  17. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab.egg-info/SOURCES.txt +0 -0
  18. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab.egg-info/dependency_links.txt +0 -0
  19. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab.egg-info/entry_points.txt +0 -0
  20. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab.egg-info/requires.txt +0 -0
  21. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/sqlite_export_for_ynab.egg-info/top_level.txt +0 -0
  22. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/testing/__init__.py +0 -0
  23. {sqlite_export_for_ynab-2.2.0 → sqlite_export_for_ynab-2.3.0}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite_export_for_ynab
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: SQLite Export for YNAB - Export YNAB Data to SQLite
5
5
  Home-page: https://github.com/mxr/sqlite-export-for-ynab
6
6
  Author: Max R
@@ -82,7 +82,7 @@ The relations are defined in [create-relations.sql](sqlite_export_for_ynab/ddl/c
82
82
 
83
83
  1. Some objects are pulled out into their own tables so they can be more cleanly modeled in SQLite (ex: subtransactions, loan account periodic values).
84
84
  1. Foreign keys are added as needed (ex: plan ID, transaction ID) so data across plans remains separate.
85
- 1. Two new views called `flat_transactions` and `scheduled_flat_transactions`. These allow you to query split and non-split transactions easily, without needing to also query `subtransactions` and `scheduled_subtransactions` respectively. They also filter out deleted transactions/subtransactions and project payee/category fields to make querying more ergonomic.
85
+ 1. Two new views called `flat_transactions` and `scheduled_flat_transactions`. These allow you to query split and non-split transactions easily, without needing to also query `subtransactions` and `scheduled_subtransactions` respectively. They also filter out deleted/unapproved transactions/subtransactions and project payee/category fields to make querying more ergonomic.
86
86
 
87
87
  ## Querying
88
88
 
@@ -136,6 +136,7 @@ WITH used_payees AS (
136
136
  FROM transactions
137
137
  WHERE
138
138
  TRUE
139
+ AND approved
139
140
  AND payee_id IS NOT NULL
140
141
  AND NOT deleted
141
142
  UNION
@@ -62,7 +62,7 @@ The relations are defined in [create-relations.sql](sqlite_export_for_ynab/ddl/c
62
62
 
63
63
  1. Some objects are pulled out into their own tables so they can be more cleanly modeled in SQLite (ex: subtransactions, loan account periodic values).
64
64
  1. Foreign keys are added as needed (ex: plan ID, transaction ID) so data across plans remains separate.
65
- 1. Two new views called `flat_transactions` and `scheduled_flat_transactions`. These allow you to query split and non-split transactions easily, without needing to also query `subtransactions` and `scheduled_subtransactions` respectively. They also filter out deleted transactions/subtransactions and project payee/category fields to make querying more ergonomic.
65
+ 1. Two new views called `flat_transactions` and `scheduled_flat_transactions`. These allow you to query split and non-split transactions easily, without needing to also query `subtransactions` and `scheduled_subtransactions` respectively. They also filter out deleted/unapproved transactions/subtransactions and project payee/category fields to make querying more ergonomic.
66
66
 
67
67
  ## Querying
68
68
 
@@ -116,6 +116,7 @@ WITH used_payees AS (
116
116
  FROM transactions
117
117
  WHERE
118
118
  TRUE
119
+ AND approved
119
120
  AND payee_id IS NOT NULL
120
121
  AND NOT deleted
121
122
  UNION
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = sqlite_export_for_ynab
3
- version = 2.2.0
3
+ version = 2.3.0
4
4
  description = SQLite Export for YNAB - Export YNAB Data to SQLite
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -181,7 +181,6 @@ SELECT
181
181
  , t.plan_id
182
182
  , t.account_id
183
183
  , t.account_name
184
- , t.approved
185
184
  , t.cleared
186
185
  , t."date"
187
186
  , t.debt_transaction_type
@@ -227,6 +226,7 @@ INNER JOIN categories AS c
227
226
  )
228
227
  WHERE
229
228
  TRUE
229
+ AND t.approved
230
230
  AND NOT COALESCE(st.deleted, t.deleted)
231
231
  ;
232
232
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite_export_for_ynab
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: SQLite Export for YNAB - Export YNAB Data to SQLite
5
5
  Home-page: https://github.com/mxr/sqlite-export-for-ynab
6
6
  Author: Max R
@@ -82,7 +82,7 @@ The relations are defined in [create-relations.sql](sqlite_export_for_ynab/ddl/c
82
82
 
83
83
  1. Some objects are pulled out into their own tables so they can be more cleanly modeled in SQLite (ex: subtransactions, loan account periodic values).
84
84
  1. Foreign keys are added as needed (ex: plan ID, transaction ID) so data across plans remains separate.
85
- 1. Two new views called `flat_transactions` and `scheduled_flat_transactions`. These allow you to query split and non-split transactions easily, without needing to also query `subtransactions` and `scheduled_subtransactions` respectively. They also filter out deleted transactions/subtransactions and project payee/category fields to make querying more ergonomic.
85
+ 1. Two new views called `flat_transactions` and `scheduled_flat_transactions`. These allow you to query split and non-split transactions easily, without needing to also query `subtransactions` and `scheduled_subtransactions` respectively. They also filter out deleted/unapproved transactions/subtransactions and project payee/category fields to make querying more ergonomic.
86
86
 
87
87
  ## Querying
88
88
 
@@ -136,6 +136,7 @@ WITH used_payees AS (
136
136
  FROM transactions
137
137
  WHERE
138
138
  TRUE
139
+ AND approved
139
140
  AND payee_id IS NOT NULL
140
141
  AND NOT deleted
141
142
  UNION
@@ -207,6 +207,7 @@ TRANSACTIONS: list[dict[str, Any]] = [
207
207
  "amount": -10000,
208
208
  "amount_formatted": "$10.00",
209
209
  "amount_currency": 10.0,
210
+ "approved": True,
210
211
  "category_id": CATEGORY_ID_3,
211
212
  "category_name": CATEGORY_NAME_3,
212
213
  "deleted": False,
@@ -239,6 +240,7 @@ TRANSACTIONS: list[dict[str, Any]] = [
239
240
  "amount": -15000,
240
241
  "amount_formatted": "$15.00",
241
242
  "amount_currency": 15.0,
243
+ "approved": True,
242
244
  "category_id": CATEGORY_ID_2,
243
245
  "category_name": CATEGORY_NAME_2,
244
246
  "deleted": True,
@@ -250,6 +252,7 @@ TRANSACTIONS: list[dict[str, Any]] = [
250
252
  "amount": -19000,
251
253
  "amount_formatted": "$19.00",
252
254
  "amount_currency": 19.0,
255
+ "approved": False,
253
256
  "category_id": CATEGORY_ID_4,
254
257
  "category_name": CATEGORY_NAME_4,
255
258
  "deleted": False,
@@ -314,6 +314,7 @@ def test_insert_transactions(cur):
314
314
  "amount": -10000,
315
315
  "amount_formatted": "$10.00",
316
316
  "amount_currency": 10.0,
317
+ "approved": 1,
317
318
  "category_id": CATEGORY_ID_3,
318
319
  "category_name": CATEGORY_NAME_3,
319
320
  "deleted": False,
@@ -325,6 +326,7 @@ def test_insert_transactions(cur):
325
326
  "amount": -15000,
326
327
  "amount_formatted": "$15.00",
327
328
  "amount_currency": 15.0,
329
+ "approved": 1,
328
330
  "category_id": CATEGORY_ID_2,
329
331
  "category_name": CATEGORY_NAME_2,
330
332
  "deleted": True,
@@ -336,6 +338,7 @@ def test_insert_transactions(cur):
336
338
  "amount": -19000,
337
339
  "amount_formatted": "$19.00",
338
340
  "amount_currency": 19.0,
341
+ "approved": 0,
339
342
  "category_id": CATEGORY_ID_4,
340
343
  "category_name": CATEGORY_NAME_4,
341
344
  "deleted": False,
@@ -370,19 +373,6 @@ def test_insert_transactions(cur):
370
373
 
371
374
  cur.execute("SELECT * FROM flat_transactions ORDER BY amount")
372
375
  assert [strip_nones(d) for d in cur.fetchall()] == [
373
- {
374
- "transaction_id": TRANSACTION_ID_3,
375
- "plan_id": PLAN_ID_1,
376
- "date": "2024-03-01",
377
- "id": TRANSACTION_ID_3,
378
- "amount": -19000,
379
- "amount_formatted": "$19.00",
380
- "amount_currency": 19.0,
381
- "category_id": CATEGORY_ID_4,
382
- "category_name": CATEGORY_NAME_4,
383
- "category_group_id": CATEGORY_GROUP_ID_2,
384
- "category_group_name": CATEGORY_GROUP_NAME_2,
385
- },
386
376
  {
387
377
  "transaction_id": TRANSACTION_ID_1,
388
378
  "subtransaction_id": SUBTRANSACTION_ID_1,