qifparse
qifparse copied to clipboard
Transaction amount is parsed as a float
You need to parse your numbers using decimal.Decimal() to avoid storing the numbers as binary and losing the precision. You're using float() right now, which converts the string to an IEEE float. Definitely use Decimal, or in the worst case, provide the original string for the number as a field on the transaction object, so others can initialize a Decimal instance.
Note: decimal now comes standard with Python 3.4.
Thanks for your work, I was able to really quickly put together an importer script for LedgerHub for a new account I have that only exports QIF format.