Skip to content

Instantly share code, notes, and snippets.

@gavinhughes
Last active August 31, 2018 18:51
Show Gist options
  • Save gavinhughes/32e80a57fa666ac691db8271914a407d to your computer and use it in GitHub Desktop.
Save gavinhughes/32e80a57fa666ac691db8271914a407d to your computer and use it in GitHub Desktop.
Ledger Recur - Automated entry of recurring transactions into ledger files

Ledger Recur

Ledger Recur provides automated entry of recurring transactions into ledger files.

The command `recur journal.ledger recurring.rcr` enters all recurring transactions specified in the file `recurring.rcr` into the file `journal.ledger`.

A recur file is parsed before transactions are entered into a ledger file. If erorrs are found, they are reported and no transactions are entered.

Recur file syntax

Transactions

Payee
    /recurrence/ /[end_date]/
    /last_applied_date/
    [Remaining lines applied verbatim]

Example

Dropbox
  1M22 E2018/12/31
  2018/08/30
  ; d: Pro subscription
  ; :recur:
  software  $10

Recurrence syntax

IntervalInterpreted as
1W1,3,5Every week on Mon, Wed, Fri.
2W5Every two weeks on Fri.
1M22Every 1 month on the 22nd.
1M1,15Every 1 month on the 1st and 15th.
1Mw7Every 1 month on the first Sun.
1Y01/08Every 1 year on Jan-08.
interval E2018/01/08The recur terminates on 2018/01/08.

Command line syntax

recur ledger_file recur_file

If a recur file is not supplied, recur will look for a file with the same name as the ledger file but with an added extension of `.rcr`.

Example,

recur main.ldg

expands to

recur main.ldg main.ldg.rcr

Options

-d–dry-runSimulate but do not enter transaction. Reports errors and warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment