mirror of
https://notabug.org/scuti/amort
synced 2024-11-25 16:28:50 +05:30
removed example; added Makefile
This commit is contained in:
parent
ed2e72267c
commit
5cc813a346
7
Makefile
Normal file
7
Makefile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
reference:
|
||||||
|
amortize -P 100000 -r 0.05 -f monthly -n 36 -s > ref.txt
|
||||||
|
|
||||||
|
test:
|
||||||
|
python amort.py -p 100000 -i 5.0 -t 3 -ot "{\"payment_number\":13,\"amount\":5000}"
|
||||||
|
|
9
amort.py
9
amort.py
@ -74,10 +74,6 @@ def get_totals(amortization_schedule, func=None):
|
|||||||
return total_paid, total_interest_paid, total_principal_paid
|
return total_paid, total_interest_paid, total_principal_paid
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Example usage
|
|
||||||
# principal = 100000
|
|
||||||
# interest_rate = 5.0
|
|
||||||
# loan_term = 3
|
|
||||||
def get_arguments():
|
def get_arguments():
|
||||||
p = argparse.ArgumentParser()
|
p = argparse.ArgumentParser()
|
||||||
p. add_argument("--principal", "-p", type=float, \
|
p. add_argument("--principal", "-p", type=float, \
|
||||||
@ -123,11 +119,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
principal, interest_rate, loan_term, extra_payments = get_arguments()
|
principal, interest_rate, loan_term, extra_payments = get_arguments()
|
||||||
|
|
||||||
# one_time_payment = {
|
|
||||||
# 'payment_number': 13,
|
|
||||||
# 'amount': 5000
|
|
||||||
# }
|
|
||||||
|
|
||||||
schedule = generate_amortization_schedule(principal, interest_rate, loan_term, extra_payments)
|
schedule = generate_amortization_schedule(principal, interest_rate, loan_term, extra_payments)
|
||||||
paid, interest_paid, principal_paid = get_totals(schedule,export)
|
paid, interest_paid, principal_paid = get_totals(schedule,export)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user