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

Transactions skipped due to date #9

Closed
stefanjf opened this issue May 2, 2016 · 5 comments
Closed

Transactions skipped due to date #9

stefanjf opened this issue May 2, 2016 · 5 comments

Comments

@stefanjf
Copy link

stefanjf commented May 2, 2016

I'm trying to use csv2ofx in python as a library. I'm using the "normal OFX usage" example code found in the README. However, none of the transactions are getting exported to OFX. I narrowed it down to this line in the "clean_trxns" function:
filtered_trxns = it.ifilterfalse(self.skip_transaction, trxns)

It seems as though they're being skipped because they don't fall within the right dates. Is there a clean way to set the start/end dates when using as a library?

@reubano
Copy link
Owner

reubano commented May 4, 2016

Can you please provide the data file you used?

@szst11
Copy link

szst11 commented Aug 6, 2016

I just had the same issue and I think, it has to do with an unspecified start-date. If this is not specified, it is declared in the init-file:
self.start = kwargs.get('start', dt.now())
as now. So every transaction is out of date.
My workaround is this:
from dateutil.parser import parse okwargs = {'start': parse('2010-01-01')} ofx = OFX(mapping,**okwargs)

So I think the start-date should have a useful value(as it is in the cli) or the documentation should be changed.

@reubano
Copy link
Owner

reubano commented Aug 7, 2016

FWIW, you can just do...

from datetime import datetime as dt
ofx = OFX(mapping, start=dt(2000, 1, 1))

Also, which date would you like the default to use?

Edit: you were right... the previous version was incorrect.

@szst11
Copy link

szst11 commented Aug 7, 2016

just something in the past, so that it is no exclusion for typical data. Let's say '2000-01-01'

@reubano
Copy link
Owner

reubano commented Aug 8, 2016

Is there a clean way to set the start/end dates when using as a library?

from datetime import datetime as dt
from csv2ofx.ofx import OFX
from csv2ofx.mappings.default import mapping

ofx = OFX(mapping, start=dt(2010, 1, 1), end=dt(2015, 1, 1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants