csingley / ofxtools

Python OFX Library
Other
301 stars 68 forks source link

Merchant Category Codes #136

Closed jonathanmorlen closed 3 years ago

jonathanmorlen commented 3 years ago

I am trying to tag my transactions for budgeting purposes by doing it manually right now. It would be much easier to automatically tag the majority based on merchant category codes. Would it be possible to surface the merchant category codes through ofxget?

csingley commented 3 years ago

ofxget is a simple utility that does just what it says on the tin - it gets OFX data. If your OFX downloads include MCC tags (maybe in transaction memo field) then you're good, otherwise you have some work to do.

Enabling this kind of work to be done is exactly why I built ofxtools in the first place. You'll want to get familiar with the rest of the library, specifically ofxtools.Parser and the various ofxtools.models classes.

So, like, you could maintain a dictionary mapping payees to MCC, parse a CCSTMTRS, iterate over each transaction, and look this up.