用于计算摊销和生成摊销计划的python库
amortization的Python项目详细描述
摊销
用于计算摊销和生成摊销计划的python库
License | Version | ||
Travis CI | AppVeyor | ||
Coverage | Wheel | ||
Status | Downloads | ||
Supported versions | Implementation |
演示
安装
pip install amortization
使用cython
构建pip install cython pip install amortization
用法
Python
摊销额
fromamortization.amountimportcalculate_amortization_amountamount=calculate_amortization_amount(150000,0.1,36)
摊销计划
fromamortization.scheduleimportamortization_schedulefornumber,amount,interest,principal,balanceinamortization_schedule(150000,0.1,36):print(number,amount,interest,principal,balance)
摊销计划(使用表格)
fromamortization.scheduleimportamortization_schedulefromtabulateimporttabulatetable=(xforxinamortization_schedule(150000,0.1,36))print(tabulate(table,headers=["Number","Amount","Interest","Principal","Balance"],floatfmt=",.2f",numalign="right"))
命令行
amortize -h usage: amortize [-h] -P PRINCIPAL -n PERIOD -r INTEREST_RATE [-s] Python library for calculating amortizations and generating amortization schedules optional arguments: -h, --help show this help message and exit -s, --schedule Generate amortization schedule required arguments: -P PRINCIPAL, --principal PRINCIPAL Principal amount -n PERIOD, --period PERIOD Total number of periods -r INTEREST_RATE, --interest-rate INTEREST_RATE Interest rate per period
amortize -P 150000 -n 36 -r 0.1 -s