Skip to content

Commit 3f0de7b

Browse files
committed
Use loop for input rules
1 parent 5c37883 commit 3f0de7b

File tree

3 files changed

+18
-27
lines changed

3 files changed

+18
-27
lines changed

.beanhub/imports.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
inputs:
2-
- match: "import-data/connect/chase/*.csv"
2+
- match: "import-data/connect/{{ match_path }}"
33
config:
44
default_file: main.bean
55
prepend_postings:
6-
- account: Liabilities:ChaseCreditCard
7-
amount:
8-
number: "{{ -amount }}"
9-
currency: "{{ currency | default('USD', true) }}"
10-
- match: "import-data/connect/Wells Fargo/SAVING ...5678/*.csv"
11-
config:
12-
default_file: "books/{{ date.year }}.bean"
13-
prepend_postings:
14-
- account: Assets:Bank:US:WellsFargo:Saving
15-
amount:
16-
number: "{{ -amount }}"
17-
currency: "{{ currency | default('USD', true) }}"
18-
- match: "import-data/connect/American Express/Blue Cash Everyday®/*.csv"
19-
config:
20-
default_file: "books/{{ date.year }}.bean"
21-
prepend_postings:
22-
- account: Liabilities:CreditCard:US:AMEXBlueCashEveryday
6+
- account: "{{ input_account }}"
237
amount:
248
number: "{{ -amount }}"
259
currency: "{{ currency | default('USD', true) }}"
10+
loop:
11+
- match_path: "chase/*.csv"
12+
input_account: Liabilities:ChaseCreditCard
13+
- match_path: "Wells Fargo/SAVING ...5678/*.csv"
14+
input_account: Assets:Bank:US:WellsFargo:Saving
15+
- match_path: "American Express/Blue Cash Everyday®/*.csv"
16+
input_account: Liabilities:CreditCard:US:AMEXBlueCashEveryday
2617

2718
imports:
2819
- name: Routines

poetry.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ readme = "README.md"
88
[tool.poetry.dependencies]
99
python = "^3.11"
1010
beanhub-cli = "^2.1.0"
11-
beanhub-import = "1.0.6"
11+
beanhub-import = "1.1.1"
1212

1313

1414
[build-system]

0 commit comments

Comments
 (0)