Skip to main content

Link receipts to bank statement transactions

Project description

receipt-statement-linker

Python program that links receipts/invoices to bank statements, extracting data from both into a single json file.

Sample receipt:

image

Sample bank statement transaction:

image

Sample linker output:

image

Command Line Options

  • --receipt-input receipt.jpg - Receipt/invoice files to process
  • --statement-input statement.pdf - Bank statement files to process
  • --receipt-output output.json - JSON filepath for output
  • --categorize - Turn categorization on
  • --categories category1 category2 ... - Categories to use for categorization (optional)

Config file

The config file can be found at $XDG_CONFIG_HOME/receipt_statement_linker/config.toml. The config file has the following fields:

  • transcription_model - model used for receipt & statement transcription.
  • categorization_model - model used for receipt & statement categorization, if enabled.
  • matching_model - model used for matching receipts to statement transactions when multiple transaction prices match the receipt price.
  • categorization_notes - notes to provide extra context to the model when categorizing

Models are litellm model strings. You can find them by going here and selecting a provider.

Categorization

With categorization on, each entry will include a category for the transaction, and categorization for each item within the associated receipt. The default categories are:

DEFAULT_CATEGORIES = [
  "GROCERIES",
  "EATING_OUT",
  "TRANSPORTATION",
  "HOUSING",
  "HEALTHCARE",
  "PERSONAL_CARE",
  "ENTERTAINMENT",
  "SAVINGS_AND_INVESTMENTS",
  "DEBT_PAYMENT",
  "UTILITIES",
  "MISC",
]

Custom categories can be specified using --categories category1 category2 ....

Only labels may not be enough context for the categorization. To add more context to give to the model, you can add context in the config file like so:

categorization_notes = "'Liberty' is a theatre, so it falls under entertainment."

Supported Filetypes

The filetypes that are supported are based on whatever model is selected. The defualt is Gemini 2.5 Flash, and supported filetypes for this model can be found here.

Example

A sample invoice and statement can be found under example/. The output of running the following command can be found at example/example.json:

uvx receipt-statement-linker \
          --receipt-input     example/invoice-sample.pdf \
          --statement-input   example/bank-statement-sample.pdf \
          --categorize \
          --receipt-output    example/example.json

Project details


Download files

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

Source Distribution

receipt_statement_linker-0.2.1.tar.gz (145.8 kB view details)

Uploaded Source

Built Distribution

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

receipt_statement_linker-0.2.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for receipt_statement_linker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 21b6ac5d9856bf665d5ebb6d8c6fbd8edd169c6518c3890771a20aa46d2300e1
MD5 596aeec36aba683f812f38dcf651c38b
BLAKE2b-256 00f4ed228131bfb687ce8202a5ec6ce1181f4d0ee546bdfb3da46e56864d5a2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for receipt_statement_linker-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f454d6fc227841cf4bce86d04885a9994e9da7ba6ba6d2cb119344092f8589e4
MD5 cce3c5f9ad8a2e38bbc51d0d832b12c1
BLAKE2b-256 e6dd70d75916fa00eae96cc55617ac1dd3bc71726aab2062b65948db46c032b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page