Skip to content

Commit

Permalink
ofxgetter - add ability to specify how many days of data to retrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Jun 9, 2018
1 parent 97ad030 commit 41ce320
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Unreleased Changes
* ``biweeklybudget.screenscraper.ScreenScraper`` - Add option to explicitly set a User-Agent on Chrome or PhantomJS.
* `Issue #192 <https://github.com/jantman/biweeklybudget/issues/192>`_ - Fix bug where the ``is_`` fields weren't set on OFXTransactions when created via ofxgetter remote API.
* ``ofxgetter`` - add support to list all accounts at the Institution of one account
* ``ofxgetter`` - add ability to specify how many days of data to retrieve

0.7.1 (2018-01-10)
------------------
Expand Down
7 changes: 5 additions & 2 deletions biweeklybudget/ofxgetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ def parse_args():
type=str, default=None,
help='Statement save path; must be specified when running '
'in remote (-r) mode.')
p.add_argument('-d', '--days', dest='days', action='store', type=int,
default=30,
help='number of days of history to get; default 30')
p.add_argument('ACCOUNT_NAME', type=str, action='store', default=None,
nargs='?',
help='Account name; omit to download all accounts')
Expand Down Expand Up @@ -327,15 +330,15 @@ def main():
raise SystemExit(0)

if args.ACCOUNT_NAME is not None:
getter.get_ofx(args.ACCOUNT_NAME)
getter.get_ofx(args.ACCOUNT_NAME, days=args.days)
raise SystemExit(0)
# else all of them
total = 0
success = 0
for acctname in sorted(OfxGetter.accounts(client).keys()):
try:
total += 1
getter.get_ofx(acctname)
getter.get_ofx(acctname, days=args.days)
success += 1
except Exception:
logger.error(
Expand Down

0 comments on commit 41ce320

Please sign in to comment.