rienafairefr / pynYNAB

a python client for the new YNAB
MIT License
138 stars 12 forks source link

CSV import improvements #6

Closed abesto closed 8 years ago

abesto commented 8 years ago

First of all: thank you so much for building this. With YNAB4 I had a script that transformed the CSV exports of my bank into CSV that YNAB4 could eat; with your tool now, I can just feed that directly to YNAB5.

This PR contains minor fixes for the csvimport.py script.

rienafairefr commented 8 years ago

I checked it out locally and I think tests fail for compatibility, which version does this work on ? I get a TypeError: decoding str is not supported on python 3.4 at the [unicode(cell, 'utf-8') for cell in row] line ?

abesto commented 8 years ago

Oh, I see; I only tested with python 2.7. Let me see if I can make it work on both versions...

Side-note: when I try to run tests, I get this failure:

======================================================================
ERROR: test_duplicate (test_csvimport.TestCsv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/abesto/playground/otp2ynab/virtualenv/src/nynabapi-abesto/tests/test_csvimport.py", line 40, in test_duplicate
    with open(args.csvfile, mode='w') as f:
IOError: [Errno 2] No such file or directory: 'data/test.csv'
rienafairefr commented 8 years ago

Well, open(args.csvfile, mode='w') should create the file if it does not exist, but in that case it might be that data directory that does not exist. Ah, it's not been committed, of course. I'll add code to create the data dir

rienafairefr commented 8 years ago

Thanks abesto, I've cherry picked all these commits by now I think

abesto commented 8 years ago

Indeed. Thanks for all the hard work! Let me know if I can help more; I'm building my home finance automation on your work, would love to contribute back.