csv2ofx
csv2ofx copied to clipboard
Ideas for improving the documentation
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
andclass
get combined into the<MEMO>
element - Explain how splits work.
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!
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.
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')}
.
To parse xero.csv you would add
--collapse Description --mapping xero
to the command.
This works because xero.py
has mapping = {'is_split': True, ...}
.
CR #16
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.