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.

Comamnd 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 it on these sample docs using the args --receipt-input example/invoice-sample.pdf --statement-input example/bank-statement-sample.pdf --categorize --receipt-output example/example.json is found under 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.0.tar.gz (145.6 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.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for receipt_statement_linker-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6eb26e8d5dfc54bfccaa94deb4d948b6950a0ed9d0f36c6f6626c072bca989bc
MD5 cde6e580cb7fe80bc5c230874181d8c6
BLAKE2b-256 9b32a4c9edeff6898cede4d8e7e08310eacc0534b076ba92c5483bffe76dda0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for receipt_statement_linker-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a39c776f2e235cd817a772b8298c28f7cad159464c2a25c2a49ef7a4bc02ef8
MD5 61c7776edbf4a099d5c7dcb4d1a77365
BLAKE2b-256 886b65751b562397be255a0b3b7ce66171070335800109551aebb726306e0893

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