forked from jbms/beancount-import
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
executable file
·44 lines (36 loc) · 1.23 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
import glob
import os
import json
import sys
def run_reconcile(extra_args):
import beancount_import.webserver
journal_dir = os.path.dirname(__file__)
data_dir = os.path.join(os.path.dirname(__file__), '..', 'data')
data_sources = [
dict(
module='beancount_import.source.mint',
filename=os.path.join(data_dir, 'mint/mint.csv'),
),
dict(
module='beancount_import.source.ofx',
ofx_filenames=[os.path.join(data_dir, 'ofx/checking2.ofx'),
],
),
]
beancount_import.webserver.main(
extra_args,
journal_input=os.path.join(journal_dir, 'journal.beancount'),
ignored_journal=os.path.join(journal_dir, 'ignored.beancount'),
default_output=os.path.join(journal_dir, 'transactions.beancount'),
open_account_output_map=[
('.*', os.path.join(journal_dir, 'accounts.beancount')),
],
balance_account_output_map=[
('.*', os.path.join(journal_dir, 'accounts.beancount')),
],
price_output=os.path.join(journal_dir, 'prices.beancount'),
data_sources=data_sources,
)
if __name__ == '__main__':
run_reconcile(sys.argv[1:])