Joining shapefiles is a relatively straightforward proess in QGIS using 'add vector join' in the layer properties menu. I can add a csv file as a vector layer, as well as a shapefile, and join the two using a common field.

I would like to do a similar join using pyQGIS, however I can't seem to find any documentation on how to go about this. Is this possible to do programmatically using pyQGIS with 'add vector join' or the older 'Join by Attributes'? Or, alternately, might there be any other Python modules that might be able to merge a csv with a shapefile before loading as a map layer with pyQGIS?