Fix missed spot from `dict` subclassing
Simplify `needs_categorization`
Filter transactions in BCD only once
Turn single-legged transactions with ugly memos into balanced transactions with readable metadata.
$ categorize
"`" to skip a transaction;
^C or ^D to write and quit.
2024-01-01 * "D-CHAT GRILL"
Liabilities:Card 1.00 USD
Government | California DMV
NPO | Feed the Childrens
Bookstore | 1652 Valencia
>
Here you would enter, e.g., Restaurant | D-Chat Grill
.
The program confirms the entry and prompts for a Beancount account (or "category").
> ('Restaurant', 'D-Chat Grill')
Expenses:Arts
Expenses:Donations
Expenses:Car
>
After you've set the payee, narration, and account, you may elect to categorize all future transactions with the same memo likewise:
> ('Restaurant', 'D-Chat Grill')
>
Expecting more of these? [y/N]: y
Edit rule before saving? [y/N]: n
TODO
If a config file is not present, the default values at ./beancount_categorize/config.py
will be used.
skip
(list of strings)Regexes of narrations of transactions that should be skipped.
For example, with skip = ["Padding inserted", "^Pay"]
, the following transactions would be:
Padding inserted
: skippedPadding-inserted
: categorizedPayless Shoe Source
: skippedPaddington Station
: categorizedPayPal
: skippedHell to Pay
: categorizedpos
(list of strings)Known point-of-sale prefixes. categorize
will strip these when storing and evaluating rules.
For example, with SQ
as a POS prefix, all of these narrations will be matched by the rule regex /^RESTAURANT/
:
SQ*RESTAURANT
SQ *RESTAURANT
SQ* RESTAURANT
SQ * RESTAURANT
indent
(string)The indent to prepend to metadata and posting lines.
skip:
-
pos:
- PAYPAL
- SQ
- TST
indent: " "
categorize
assumes an import workflow resembling the following.
bean-extract config.py -f main.beancount download > tmp.beancount
The CLI options are tailored accordingly:
-i
, --input
: The file with the transactions you wish to categorize.-j
, --journal
: The file with the rest of your Beancount data. It must contain all Open
directives or include files that do.-r
, --rules
: Stored categorization rules.