I think you can do that just with the great internal tool from QGIS3 and without any knowledge of python. All within the graphical interface. You can access to the importing format (extension) by clicking in the '...' in the output element. Here you have the complete video with the process (I can't even upload here the complete gif...).
Here are some ...
Another work-around is to specify the field types while in Excel, and then save as an xlsx file. When you import the .xlsx file to QGIS, your field types will be maintained. This does not work if you specify the field types in Excel and then save as CSV.
I'm not sure this is the answer to your question, but anyhow.
I often regularly change a shapefile externally, in my case when working on a C++ program and effectively using QGIS as the visual part of the debugger :)
I removed and reloaded the layer often, now I simply start an editing session and close it.
Done, i.e. I get the refreshed shape. This is going ...
Tested on QGIS 2.18 and QGIS 3.4
Let's assume there is a .csv-file "data" with its attributes accordingly, see image below.
Simply drag&drop it into QGIS, so it can appear in the 'Layers Panel', like this
Then proceed with a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer...
With the following Query, it is possible to plot ...
Create a column in your csv file named WKT
For each row, populate the column with: Point (longitude, latitude)
Add the data to QGIS project by using: Layer > Add Layer > Add Delimited Text Layer...
Set the Geometry Definition to Well Known Text and select WKT as the Geometry field and you should be good to go.
*Note: You must select an ...
Use the Delimited Text Data Source type to point to your CSV file, choose whether or not to have headers, choose the columns for X/Y/Z/M data, and then finally your CRS.
Make use of the Sample Data box to ensure you have the settings correct.
Ok, thanks to Vince and ahmadhanb for the guidance. I was convinced the issue was with my lack of my python skills but I went back to square one and looked at my data after and found the first row of my CSV was 'pathname' and was the cause of the error.