finance_tools is a set of common financial calculations.
pv(cash_flow, period, cost_of_capital)
** cash_flow: this is self-explanatory, it's the amount of cash flowing in or out
** period: the period in which this cash flow occurs. It should match the cost_of_capital's period. For example, if you're paying an quarterly interest rate of 5%, your cash_flow should be a quarterly number and your cost_of_capital should be .05.
** cost_of_capital: The weighted average cost of capital for your business. If you're capital structure is 50% debt and 50% equity, you would calculate your cost_of_capital by evently weighting your interest rate on debt and expected rate of return on equity. If you are simply seeing how much a certain amount of cash will be worth in the future, the cost_of_capital is the risk-free interest rate, a good proxy for that is the rate of a short-term government bond because theoretically, those have no risk of default.
Output: the present value of the cash flow.
Sample: the value of recieving $100 in 2 years, assuming an annual risk-free interest rate of 3%:
>>> from finance_tools import pv
>>> pv(100, 2, .03)