Beancount言語構文
This content is a draft and will not be included in production builds.
Beancount言語の構文をまとめるが、網羅するのではなく覚えておいたほうが良いことだけを抜粋する。公式ドキュメントはBeancount Language Syntaxにある。
取引記録(Transaction)
Section titled “取引記録(Transaction)”以下のようなトランザクションを書く。科目名についてはBeancountの勘定科目で定義する。
2024-10-15 * ツクモex PCパーツ Liabilities:Amex:CreditCard 45,000 JPY Expenses:Shopping 45,000 JPY2024-10-18 * リバティ長岡 食材 Expenses:Food:Groceries 1,300 JPY Assets:Cash -1,300 JPYこれを一般化すると次のようなルールとなる。
YYYY-MM-DD [txn|Flags] [[Payee] Narrattion] [[key: value] ...] [Flags] Account Amountトランザクションの各行にはメタデータで id を与えられるらしいので、インポートした場合に重複があるかどうかの判定はこれを使うといいのだろう。