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
)

MIT License


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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lunchmoney_transaction_enhancer-0.2.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file lunchmoney_transaction_enhancer-0.2.1.tar.gz.

File metadata

  • Download URL: lunchmoney_transaction_enhancer-0.2.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for lunchmoney_transaction_enhancer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 08bfadd35140eaea4ab08a1b7f2e2591804010ffdd2cdf09cc894594556cb534
MD5 7f7e7271e12f8341f7201620755104f5
BLAKE2b-256 f2aa55c1a207829802c182b27c65b324d16c00162c4961d22d25de87859870ff

See more details on using hashes here.

File details

Details for the file lunchmoney_transaction_enhancer-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: lunchmoney_transaction_enhancer-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for lunchmoney_transaction_enhancer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e02602610460e61995d95d04281e525ac84d1918acb7905e4e63c9d024c4d97
MD5 00f848b19f456f96cce7cf33842a7302
BLAKE2b-256 6ac076dbebcf844b3bf32a0dd4366134b1f5a4abf102090711775b42b2338b03

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

This release

0.2.1 This release

2 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