This is a coding project case study for a portfolio construction. The code is not organized in an object-oriented way, but it is organized in a way that is easy to understand and follow. For more complex projects, I would suggest organizing the code in an object-oriented way. It will make the code more, scalable, readable and maintainable.
The code is structured in the following way:
--data
|--data_handler.py
Class DataHandler
|--uti.py
Host the utility functions for nearest PD matrix and risk parity construction.
main_chart_plotter.py: Used for running the code for word cloud chart.
main_q2.py: main code for running the code for step by step portoflio construction.
The code is using common libraries such as pandas, numpy, matplotlib, and scipy. The optimizer is using cvxpy library. The environment is managed using conda. If you need to create the environment, you can use the environment.yml file to create the environment.
To create the environment, run the following command:
conda env create -f environment.yml
To activate the environment, run the following command:
conda activate case_24
Ref: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
For any questions, please feel free to contact me.