Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""Description."""
import click
def PMT(rate, nper, pv, fv=0, type=0):
if rate!=0:
pmt = (rate*(fv+pv*(1+ rate)**nper))/((1+rate*type)*(1-(1+ rate)**nper))
else:
pmt = (-1*(fv+pv)/nper)
@redstreet
redstreet / per-account-files.beangulp.patch
Created November 20, 2022 00:05
Patch to write per-account files on importing into Beangulp (Beancount)
diff -c /home/username/gnu/beangulp/beangulp/extract.py ./extract.py
*** /home/username/gnu/beangulp/beangulp/extract.py 2022-10-17 22:44:19.010000000 -0700
--- ./extract.py 2022-10-18 02:29:33.010000000 -0700
***************
*** 5,10 ****
--- 5,12 ----
import datetime
import operator
import textwrap
+ import os
@redstreet
redstreet / bean-ingest.py
Last active June 6, 2022 23:05
Beancount ingest
# This is now available via the 'bean-ingest' command, installed as a part of beancount-reds-importers
# See https://github.com/redstreet/beancount_reds_importers/blob/main/beancount_reds_importers/util/bean_download.py