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.1.5.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.1.5-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for receipt_statement_linker-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d5b490021b2bb19bdef89ab76b9b8b19e479ebfe9818c61dfbccad5d05ccc807
MD5 084e61388e07719982d23738dc1fb673
BLAKE2b-256 023d9f92d2ed249c8322036572e72d947c52412c2cb3bb9df482ded398baa510

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for receipt_statement_linker-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f6c7df98ddf29a4de91d82ee45c76c6f1c44eceb9650656a82a313bef8270838
MD5 68c9ea2efaffd2f9bd4d461d2e2bec57
BLAKE2b-256 baa988ee98652e0603d99beb51674cd695a6651c72789c6a491127af0082164a

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