mint-csv-import icon indicating copy to clipboard operation
mint-csv-import copied to clipboard

Use new Mint json APIs

Open jamesgo opened this issue 2 years ago • 2 comments

import.py

  • Update transaction create to work with new Mint json APIs
  • Dynamically load categories from mint's GET categories API
  • Remove encoding considerations now that json mostly takes care of it
  • Switch from curl to requests: -- Improve cross-platform portability. Windows (cmd) has limitations with single quotes -- Inherit system proxy settings

readme.md

  • Update to align with new import.py
  • Style improvements

Other

  • Move secrets into separate file so they can be .gitignore'd
  • Cleanup artifacts of forms implementation

This should close issue #9

jamesgo avatar Jan 19 '23 08:01 jamesgo

@jamesgo Could we get more instructions on where to get the header and cookies now that the events have changed?

picard102 avatar Aug 05 '23 21:08 picard102

Thanks for updating this to the new API! Here is what I had to change for it to work properly: Remove trailing "\n" when you read from file (on Linux, there is one, idk about other platforms)

authorization = open('authorization.txt', 'r').readline()[:-1]
cookie = open('cookie.txt', 'r').readline()[:-1]

When no category is given in the CSV, it fails, because it's missing the prefix, so it should be:

if len(catName) == 0: 
    catID = categories_prefix + '20' # mint's uncategorized category

@picard102 You can follow this blogpost to find the authorization and the cookie strings. One change is that now the POST request is simply called transactions. And be careful when you copy the cookie and authorization strings, don't include the final '

You can also use this API which might be more user-friendly, but you do need to know how to code in Python: https://github.com/xinluh/yamintapi.

matthieuheitz avatar Aug 23 '23 23:08 matthieuheitz