csv2ofx icon indicating copy to clipboard operation
csv2ofx copied to clipboard

Ideas for improving the documentation

Open mscheper opened this issue 7 years ago • 6 comments

I played with this library today, hoping it'd help me convert my financial data into a format I could upload to QuickBooks. Unfortunately, QuickBooks rejects the output files, with unhelpful error messages, even though GNUCash does them.

In any case, some improvement to the README.md documentation would've helped me understand this library a little more quickly. Here are some suggestions:

  • Specify that the expected date format is MM/DD/YYYY—this is an unusual format (only two or three countries use it), so it ought to be made clear
  • Mention that, by default, future-dated transactions are excluded (some of my transactions were missing because they were from the other side of the international dateline)
  • Explain how mapping works. e.g. 'mapping should be a map of output field names to functions that return values for those fields. The functions should expect a single parameter: a map of input field names to their values. For example, { 'date': lambda r: '%s/%s/%s' % (r['month'], r['day'], r['year']) } expects the input CSV to have separate "month", "day" and "year" columns, and will combine these into a single "date" output column, in the MM/DD/YYYY format.'
  • For each field, particularly the optional ones, specify, which OFX elements they map to, e.g. that notes and class get combined into the <MEMO> element
  • Explain how splits work.

mscheper avatar Aug 03 '17 21:08 mscheper

Great ideas! #22 partially addresses this. As of the commit closing that issue, you can set a custom date format in the mapping. Also, one thing to point out is that the mapping values don't have to be functions.. something like {'date': 'txn_date'} is also acceptable. If you have time to submit a PR with necessary documentation updates, I would be very grateful!

reubano avatar Aug 04 '17 11:08 reubano

I agree, I never really explained split in detail... it's mentioned here and is easiest to understand by comparing mint.csv (not split) to xero.csv (split). To parse xero.csv you would add --collapse Description --mapping xero to the command.

reubano avatar Aug 04 '17 11:08 reubano

Also, one thing to point out is that the mapping values don't have to be functions.. something like {'date': 'txn_date'}

Sorry, I misspoke here.... {'bank': 'My Bank'} is a better example. If you pass a string, that value is used for all rows. You only need a function if the value is dependent on information in the row. E.g., in the initial example, you could have {'date': itemgetter('txn_date')}.

reubano avatar Aug 04 '17 11:08 reubano

To parse xero.csv you would add --collapse Description --mapping xero to the command.

This works because xero.py has mapping = {'is_split': True, ...}.

reubano avatar Aug 04 '17 11:08 reubano

CR #16

reubano avatar Aug 04 '17 11:08 reubano

Thanks for the reply. I'll keep this tab open, but I'm trying to get some work finished before travelling so I honestly don't think it's likely I'll have time to make good improvements any time soon. But don't give up hope. ☺ Thanks for making the code available.

mscheper avatar Aug 04 '17 15:08 mscheper