removed example; added Makefile

This commit is contained in:
- 2024-02-10 17:51:14 -08:00
parent ed2e72267c
commit 5cc813a346
2 changed files with 7 additions and 9 deletions

7
Makefile Normal file
View 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}"

View File

@ -74,10 +74,6 @@ def get_totals(amortization_schedule, func=None):
return total_paid, total_interest_paid, total_principal_paid
if __name__ == "__main__":
# Example usage
# principal = 100000
# interest_rate = 5.0
# loan_term = 3
def get_arguments():
p = argparse.ArgumentParser()
p. add_argument("--principal", "-p", type=float, \
@ -122,11 +118,6 @@ if __name__ == "__main__":
print("wrote to file", filename)
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)
paid, interest_paid, principal_paid = get_totals(schedule,export)