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.2.tar.gz (7.0 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.2.tar.gz.

File metadata

  • Download URL: lunchmoney_transaction_enhancer-0.2.2.tar.gz
  • Upload date:
  • Size: 7.0 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.2.tar.gz
Algorithm Hash digest
SHA256 dd68208397108b2ea4b50ffb8ded7d7bbe576014492f623d1c49c84c03333eda
MD5 bc100e59071e05cf41c22b838c224888
BLAKE2b-256 7fef66a082518bf4afbdfb2c6cf9fccd7bb3a49b1e8a4b825d647392be4f4621

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lunchmoney_transaction_enhancer-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd76b4d4537b7640703a8989f43fe53f78e47bc1711433e6351c28c0444c0781
MD5 c01c021eb247706cb264ed762e610335
BLAKE2b-256 d7f67dc4763ba4aa09da273ad6d1bbd6a4837bf468b12aa65cb6d2231c3d2d06

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 files

0.2.1

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