Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofx: try actual specified lower bound before binary searching to find earliest available start date #57

Merged
merged 1 commit into from
Jan 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions finance_dl/ofx.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ def get_earliest_data(account, start_date, slowdown = False):

Returns ((startdate, enddate), data).
"""
# First try the actual start_date; if it works, no binary search is needed
data = download_account_data_starting_from(account, start_date)
date_range = get_ofx_date_range(data)
if date_range is not None:
return date_range, data

logger.info(
'Binary searching to find earliest data available for account %s.',
account.number)
Expand Down