Welcome to the Financial Modeling Toolkit, a Python-based library for conducting financial analysis, valuation, risk management, and portfolio optimization.
This toolkit provides a set of classes and functions to perform various financial modeling tasks, including:
Net Present Value (NPV) calculation Internal Rate of Return (IRR) calculation Payback Period analysis Portfolio optimization for maximum Sharpe ratio Risk management with Value at Risk (VaR) Financial analysis metrics (e.g., profitability ratio, return on investment) The toolkit is designed to be modular and extensible, allowing users to incorporate additional functionalities and customize analyses based on specific requirements.
Python 3.x NumPy SciPy (for optimization)
'''bash Copy code pip install numpy scipy '''
Clone the Repository ''' bash Copy code git clone https://github.com/your_username/financial-modeling-toolkit.git cd financial-modeling-toolkit '''
python Copy code from financial_modeling import FinancialModeling Initialize FinancialModeling Object python Copy code initial_investment = -100000 cash_flows = [30000, 40000, 50000, 60000, 70000]
financial_model = FinancialModeling(initial_investment, cash_flows) Perform Financial Calculations python Copy code
discount_rate = 0.1 npv_result = financial_model.calculate_npv(discount_rate)
irr_result = financial_model.calculate_irr()
payback_period_result = financial_model.calculate_payback_period()
profitability_ratio = financial_model.calculate_profitability_ratio(50000, 200000) Explore Additional Functionalities python Copy code
expected_returns = [0.05, 0.08, 0.12] # Expected returns of assets cov_matrix = [[0.1, 0.05, 0.03], [0.05, 0.12, 0.06], [0.03, 0.06, 0.15]] # Covariance matrix optimal_weights = financial_model.calculate_optimal_portfolio_weights(expected_returns, cov_matrix)
Kampamba Shula (@kshula)
License This project is licensed under the MIT License - see the LICENSE file for details.