Package: beancount-plugins
# beancount-pluginsVarious user contributed plugins for [Beancount] (http://furius.ca/beancount/),a double-entry bookkeeping computer language.## InstallationInstall via pip```shell$ pip install beancount-plugins```## Plugins## Automatic DepreciationThis plugin looks at postings that have the 'depreciation' metadata, andgenerates new entries until the closing of the previous year to depreciate thevalue of the account on which the metadata was placed.Currently, the following methods of depreciation are supported:WDV: Written Down ValueCRA: Canadian Revenue Agency method (assets purchased in current year are allowed 50% of normal rate)Example:```plugin "beancount-plugins.plugins.flexible_depreciation.depreciate" "{'method': 'WDV','year_closing_month': 12,  # Could be 3 for the fiscal year ending Mar 31.'halfdepr': True,  # Assets used less than 180 days will be depreciated at half the allowed rate that year'account': 'Expenses:Depreciation',  # Account to post depreciation entries to.'2010': 0.5, # Business only open for half year in 2010, adjust depreciation rate down.'expense_subaccount': True, #If true, will use subaccount for depreciation expense using first word in Narration.#ie: Expenses:Depreciation:Printer'asset_subaccount': True,   #If true, will use asset subaccount for depreciation expense.#ie: Assets:Fixed:Comp:Depreciation.}"2014-03-02 * "" | "Printer Purchase"Assets:Cash                                   -100.00 INRAssets:Fixed:Comp                              100.00 INRdepreciation: "Printer Depreciation @0.60"```The "depreciation" metadata has this format:```"NARRATION STRING @RATE"```The narration string here will be used in the newly generated entries.Rate should be a number, not percentage. Use "0.60" to mean "60%".## Zero SumPlugin for accounts that should sum up to zero. Determines transactionsthat when taken together, sum up to zero, and move them to a specifiedaccount. The remaining entries are the 'unmatched' ones, that need attentionfrom the user.#### Motivation:Real-world transfers frequently occur between accounts. For example, between achecking account and an investment account. When double entry bookkeeping isused to track such transfers, we end up with two problems:a) when account statements are converted to double-entry format, the userhas to manually match the transfers on account statements from the twoinstitutions involved, and remove one of the entries since they areredundant.b) even when (a) is done, the transfer might take a day or more tocomplete: the two accounts involved would then reflect the transfer ondifferent dates.Since the money is truly missing from all the physical accounts for the periodof transfer, they can be accounted for as shown in this example:```2005-01-01 TransferAssets:Bank_of_Ameriplus  -20 USDZeroSumAccount:Transfers2005-01-03 TransferAssets:TB_Trading  20 USDZeroSumAccount:Transfers```Doing so has a few advantages:a) on 2005-01-02, your assets are accurately represented:Bank_of_Ameriplus is short by $20, TB_Trading still doesn't have it, andthe ZeroSumAccount:Transfers account captures that the money is stillyours, but is "in flight."b) One can convert each bank's transactions directly into double-entryledger statements. No need to remove the transaction from one of thebanks. When you look at your journal files for each account, they matchyour account statements exactly.c) Import/conversion (from say, a bank .csv or .ofx) is easier, becauseyour import scripts don't have to figure out where a transfer goes, andcan simply assign transfers to  ZeroSumAccount:Transfersd) If there is a problem, your ZeroSumAccount:Transfers will sum to anon-zero value. Errors can therefore be found easily.#### What this plugin does:Account statements from institutions can be directly converted to double-entryformat, with transfers simply going to a special transfers account (eg:Assets:ZeroSumAccount:Transfers).In this plugin, we identify sets of postings in the specified ZeroSum accountsthat sum up to zero, and move them to a specified target account. This targetaccount will always sum up to zero and needs no further attention. Thepostings remaining in the original ZeroSum accounts were the ones that couldnot be matched, and potentially need attention.The plugin operates on postings (not transactions) in the ZeroSum accounts.This way, transactions with multiple postings to a ZeroSum account are stillmatched without special handling.The following examples will be matched and moved by this plugin:Example 1:----------Input:2005-01-01 TransferAssets:Bank_of_Ameriplus  -20 USDZeroSumAccount:Transfers2005-01-03 TransferAssets:TB_Trading  20 USDZeroSumAccount:TransfersOutput:2005-01-01 TransferAssets:Bank_of_Ameriplus  -20 USDZeroSumAccount-Matched:Transfers2005-01-03 TransferAssets:TB_Trading  20 USDZeroSumAccount-Matched:TransfersExample 2 (Only input shown):-----------------------------2005-01-01 TransferAssets:Bank_of_Ameriplus  -20 USDZeroSumAccount:Transfers   10 USDZeroSumAccount:Transfers   10 USD2005-01-03 TransferAssets:TB_Trading_A  10 USDZeroSumAccount:Transfers2005-01-04 TransferAssets:TB_Trading_B  10 USDZeroSumAccount:TransfersThe following examples will NOT be matched:Example A:----------2005-01-01 TransferAssets:Bank_of_Ameriplus  -20 USDZeroSumAccount:Transfers   10 USDZeroSumAccount:Transfers   10 USD2005-01-03 TransferAssets:TB_Trading  20 USDZeroSumAccount:TransfersExample B:----------2005-01-01 TransferAssets:Bank_of_Ameriplus  -20 USDZeroSumAccount:Transfers2005-01-03 TransferAssets:TB_Trading_A  10 USDZeroSumAccount:Transfers2005-01-03 TransferAssets:TB_Trading_B  10 USDZeroSumAccount:TransfersThe plugin does not append/remove the original set of input transactionentries. It only changes the accounts to which postings are made. The pluginalso automatically adds "Open" directives for the target accounts to whichmatched transactions are moved.#### Invoking the plugin:First, an example:plugin "beancount-plugins.plugins.zero_sum.zerosum" "{'zerosum_accounts' : {'Assets:Zero-Sum-Accounts:Bank-Account-Transfers' : ('Assets:ZSA-Matched:Bank-Account-Transfers', 30),'Assets:Zero-Sum-Accounts:Credit-Card-Payments'   : ('Assets:ZSA-Matched:Credit-Card-Payments'  ,  6),'Assets:Zero-Sum-Accounts:Temporary'              : ('Assets:ZSA-Matched:Temporary'             , 90),}}"As the example shows, the argument is a dictionary where the keys are the setof accounts on which the plugin should operate. The values are(target_account, date_range), where the target_account is the account to whichthe plugin should move matched postings, and the date_range is the range overwhich to check for matches for that account.## Split Transactions```plugin "beancount-plugins.plugins.split_transactions.split_transactions"```Documentation to come.