/lunch_money_scripts

Some scripts for lunchmoney.app

Primary LanguageRuby

Lunch Money Scripts

Install

You'll need a working Ruby environment on your machine (I use rbenv to manage mine). From there:

$ bundle

You'll also be asked for your lunch money access token, which you can create in the developer tab of your account settings.

Group Refunded Transactions

In Lunch Money, if you have two transactions with a merchant and one is for $45.13 and the other is -$45.13, they will display separately and—especially if they span multiple months—it won't be clear that the transaction was refunded and shouldn't really count as an expense. It's just noise in your transaction history.

What this script does is look through your transactions and find these offsetting charges, then create a transaction group whenever the merchant and transaction amounts are an exact match. This will effectively zero-out the transaction from your history.

To run the script, just execute this from the command line:

$ ./script/group_refunded_transactions

It will ask for your Lunch Money Access Token (and then save it in your keychain for subsequent runs), as well as what date you want to start from.

The script can also be run non-interactively with command line options like this:

$ ./script/group_refunded_transactions --access-token abcdef1234 --start-date 2020-01-01 --confirm

You can see available command-line options with the --help option:

./script/group_refunded_transactions --help
Usage: group_refunded_transactions [options]
        --api-key, --access-token [ACCESS_TOKEN]
                                     Lunch Money Access Token (V1 API Key)
    -s, --start-date [YYYY-MM-DD]    Start Date
        --[no-]confirm               Automatically confirm prompts
        --[no-]dry-run               Don't make changes in Lunch Money
    -h, --help                       Prints this help