Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new Mint json APIs #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jamesgo
Copy link

@jamesgo jamesgo commented Jan 19, 2023

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

- Move secrets into separate file so they can be .gitignore'd
- Switch from curl to requests:
-- Improve cross-platform portability. Windows (cmd) has limitations with single quotes
-- Inherit system proxy settings
- 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

readme.md
- Update to align with new import.py
- Style improvements

Other
- Cleanup artifacts of forms implementation
@picard102
Copy link

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

@matthieuheitz
Copy link

matthieuheitz commented Aug 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants