Skip to main content

Release Notes Downloads GitHub CI Status License: MIT

Enrich Lunch Money Transactions with Regex Rules

Applies regex extraction rules to your Lunch Money transactions to pull structured data out of raw payee names and Plaid metadata. Useful for extracting booking codes, reference numbers, or other patterns that Lunch Money doesn't parse on its own.

Installation

Run the CLI with uvx; it downloads the package automatically when needed.

Set your API key:

export LUNCH_MONEY_API_KEY=your_token_here

Usage

Run manually

uvx lunchmoney-transaction-enhancer

Dry run (no writes)

uvx lunchmoney-transaction-enhancer --dry-run

Run via cron

# Ensure HEARTBEAT_URL is set in your environment
uvx lunchmoney-transaction-enhancer --cron

Options

  • --lookback N — days to look back, overriding persisted state (default: 180 if no state exists)
  • --dry-run — log what would be updated without making any changes
  • --cron — wait for internet connectivity before running, send heartbeat on success

Features

  • Define regex rules against any transaction field (payee, notes, original_name) or Plaid metadata (plaid_name)
  • Extract named capture groups and format them into a target field using a template string
  • Skips updates when the target field already contains the correct value
  • Preserves existing transaction notes and logs a warning when a note enhancement is skipped
  • Persists a last-checked timestamp so each run only processes new transactions
  • Cron mode waits up to 8 hours for internet connectivity via exponential backoff, then pings a heartbeat URL (compatible with Healthchecks.io, Better Stack, etc.)

Supported Services

Service Enhancement
Airbnb Extracts the booking reference and adds it to the transaction notes
Capital One Travel Normalizes the payee and adds the purchase type—Flight, Hotel, Rental Car, or Premier Collection Hotel—to the transaction notes
Alliant Credit Union Extracts the interest APY and statement period and adds them to the transaction notes
Wise Extracts the transfer reference and adds it to the transaction notes

Note enhancements are applied only when the transaction does not already have a note. Other enhancements, such as Capital One Travel payee normalization, can still be applied independently.

Configuring Rules

Rules are defined in lunchmoney_transaction_enhancer/config.py:

ExtractionRule(
    name="Airbnb Code",
    source_field="plaid_name",  # field to match against
    pattern=r"AIRBNB \* (?P<code>[A-Z0-9]{10})",
    target_field="notes",  # field to write to
    template="Airbnb Code: {code}",  # use named capture groups as variables
)

Privacy & Data Handling

  • Account data fetched: Only transaction objects (payee, notes, amount, date, original name, and Plaid metadata) within the lookback window are retrieved via the Lunch Money API. Account balances, credentials, and other non-transaction data are never requested.
  • Local data retention: Only a single timestamp (data/last_checked.txt) is persisted locally to track state between runs. No transactions or financial details are stored on disk.
  • Logging: Transaction update logs include transaction IDs, payee names, and modified fields. Payee names and note contents may be visible in standard output or centralized log aggregators.

MIT License


This project was created from iloveitaly/python-package-template

Metadata

Release files for lunchmoney-transaction-enhancer 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lunchmoney-transaction-enhancer 0.3.0
File Size Uploaded
lunchmoney_transaction_enhancer-0.3.0.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lunchmoney-transaction-enhancer 0.3.0
File Interpreter ABI Platform
lunchmoney_transaction_enhancer-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / lunchmoney_transaction_enhancer-0.3.0.tar.gz

Download URL lunchmoney_transaction_enhancer-0.3.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
74489ec30578f1c47d28d50ac5d55c71c9fea53f6dfa72b15b8d08be28b9607f
BLAKE2b-256 checksum
How to use checksums
ac1a323ec9e457b5d2fe6400268f806482d6f3c2bb86591070b8410954e21034
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lunchmoney_transaction_enhancer-0.3.0-py3-none-any.whl

Download URL lunchmoney_transaction_enhancer-0.3.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70aaa5536538b041c8f01d9415b69b6b80b7c3b1a57606fe62fa229ce68a1b59
BLAKE2b-256 checksum
How to use checksums
6e5c08b1d24aad8a31dcef84f2f134fd93bbf05d2246959c35953a2dd3333182
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page