I have a .csv file containing financial data which is generated on a regular basis outside QGIS. Then I want to create a PyQGIS script that will add the .csv file as a layer in my project. (The idea here is I want to have the up-to-date financial data as attributes data for one of the shapefiles in the project). Is there a way to run the script automatically as soon as I open the QGIS project. Thank you
Put your script in .qgis/python/startup.py and it should run when QGIS is opened. However, this will run with any project you open, which you may not want.
So you might be better off setting up a python macro in the specific project. File > Project properties > Macros. Enable macrcos by checking the box.