Package: mint-amazon-tagger
Mint Transactions Tagger for Amazon PurchasesUPDATE - Now works with Amazon "Request My Data" ExportThis tool originally worked with the "Order History Reports", which gave one slice of information about Amazon order history. Amazon sunset this export/reporting tool on 3/20/2023. I have since adapted this tool to work with the zipfile of data produced by that slower, cumbersome, and more comprehensive "Request My Data" tool - for details on this migration, seethis issue.The most important change is that category information is not present in this export, meaning the tool cannot help you categorize never before seen items. For previously purchased items, by default the tool use the most common tagged category, based on an exact string match of the line item description.OverviewDo you order a lot from Amazon? Tired of everything showing up as "Amazon"
and category "Shopping" in mint.com? Then this tool is for you!This tool takes an Amazon "Request your data" Order export and matches
your Amazon order history with your Mint transactions. If it finds an exact matches
it will either:Update the transaction description and category if there was only 1 itemItemize the transaction - one line-item per item in the order (via Mint transaction splits)If the tool chooses poor categories for your transactions simply change it! The next time you run the tool it will remember your past personalized category edits and attempt to apply it to future purchases of the same
item. This only works if the item names match exactly. Also, you must
change all (or the majority of) all the past, tagged examples of that item for the tool to pick up the hint. Put another way: if you only change 1 past transaction and you have 10 purchases of that same item the tool will take whatever the most common category used for that item.This toolwill notretag or touch transactions that have already been
tagged. Feel free to adjust categories after the fact without fear that the
next run will wipe everything out. If you do want to re-tag
previously tagged transactions take a look at the retag_changed option.This tooldoes notsave your username or password. The tool is powered by theSelenium frameworkto automate an instance of the Chrome/Chromium browser. When running the tool it will prompt for the username and password and then enter it into the browser for you. There are options that allow for manual user operation of the login flows for both Mint and Amazon.This tooldoes notrequire an Amazon store card/Visa. All you need is to pay for your Amazon charges with an account that is synchronized with Mint. For example, if you alternate between 5 different credit cards to pay for purchases on your Amazon account, only the transactions from credit cards synchronized with Mint will get tagged.Some things the tagger cannot do:Amazon credit card award points are not reported anywhere in the order/item reports.Amazon gift cards are not yet supported (seeissue #59)SponsorshipThis project has been a passion project ofmineto better understand cashflow (critical to trend analysis and budgeting).If you have found this tool useful, please considersponsoring me.Install and Getting startedEASIEST - Pre-built binariesPlease download the latest version fromgithub's releases pageADVANCED - Docker Headless CLIYou can run the Mint Amazon Tagger via docker like so:# Check out this git repo if not already:
git clone https://github.com/jprouty/mint-amazon-tagger.git
cd mint-amazon-tagger

# Build the image:
docker build -t mint-amazon-tagger .

# Run the container:
docker run -it --rm mint-amazon-taggerIf you're using ARM, you need to build with:docker build --platform linux/amd64 -t mint-amazon-tagger .ADVANCED - Run from python sourceSetuppip3 install mint-amazon-taggerTo get the latest from time to time, update your version:pip3 install --upgrade mint-amazon-taggerChromedriver should be fetched automatically. But if you run into issues,
try this:# Mac:
brew tap homebrew/cask
brew cask install chromedriver

# Ubuntu/Debian:
# See also: https://askubuntu.com/questions/539498/where-does-chromedriver-install-to
sudo apt-get install chromium-chromedriverRunning - Full Auto GUIThis mode will fetch your Amazon Order History for you as well as tag mint.mint-amazon-taggerPlug in all your info into the app!Running - Full Auto CLIThis mode will fetch your Amazon Order History for you as well as tag mint.mint-amazon-tagger-cli --amazon_email email@cool.com --mint_email couldbedifferent@aol.comRunning - Semi-AutoThis mode requires you to fetch your Amazon Order History manually, then the
tagger automates the rest.Generate and download your Amazon Order History Reports.a. Login and visitAmazon Order History
Reportsb. "Request Report" for "Items", "charges and shipments", and "Refunds". Make sure the
date ranges are the same.c. Download the completed reports. Let's called themItems.csv charges.csv Refunds.csvfor this walk-through. Note that
Refunds is optional! Yay.(Optional) Do a dry run! Make sure everything looks right first. Run:mint-amazon-tagger-cli --items_csv Items.csv --charges_csv charges.csv --refunds_csv Refunds.csv --dry_run --mint_email yourEmail@here.comNow perform the actual updates, without--dry_run:mint-amazon-tagger-cli --items_csv Items.csv --charges_csv charges.csv --refunds_csv Refunds.csv --mint_email yourEmail@here.comSit back and relax! The run time depends on the speed of your machine,
quality of internet connection, and total number of transactions. For
reference, my machine did about 14k Mint transactions, finding 2k Amazon
matches in under 10 minutes.To see all options, see:mint-amazon-tagger-cli --helpTips and TricksNot every bank treats Amazon purchases the same, or processes transactions as quickly as others. If you are having a low match rate (look at the terminal output after completion), then try adjusting some of the options or command line flags. To see a complete list, runmint-amazon-tagger-cli --help.Some common options to try:--mint_input_include_inferred_description. This allows for more generous consideration of Mint transactions for matching. Seemore context here--mint_input_include_user_description. Similar to above; considers the current description as shown in the Mint tool (including any user edits).--max_days_between_payment_and_shipping. If your bank is slow at posting payments, adjusting this value up to 7 or more will increase your chance of matching. If you have a high volume of purchases, this can increase your chance of mis-tagging items.