Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Transaction Structure

Each transaction in kakei is represented as an association list (alist) in Lisp format. An association list is a list of key-value pairs.

Single Transaction Example

(ID-001 . ((date . "2025-01-01")
           (amount . -1000)
           (category . "Food")
           (account . "Cash")
           (memo . "")))

Transaction Fields

Each transaction contains the following fields:

FieldTypeDescriptionExample
IDStringUnique transaction identifier"ID-001"
dateStringTransaction date (YYYY-MM-DD)"2025-01-01"
amountIntegerAmount in minor units-1000 (¥-1,000)
categoryStringCategory name"Food"
accountStringAccount name"Cash"
memoStringOptional note (empty string if none)"Train pass"

Understanding the Structure

The transaction is a pair (cons cell):

  • Car (first element): Transaction ID
  • Cdr (second element): Association list of fields
(ID-001 . field-list)

The field list is itself a list of pairs:

((date . "2025-01-01")
 (amount . -1000)
 (category . "Food")
 (account . "Cash")
 (memo . ""))