I was wondering of there is a QGIS equivalent of the following Turf.js nearest point function, which can be called from a Python Script.
nearestPoint = turf.nearestPoint(currentFeature, entire_dataset)
As it happens, in QGIS, there is not exactly the same function but there is a Distance to nearest hub (points) tool in the processing toolbox that will give the distance to all of the points and then you can choose the one with the shortest distance. We can also use the select by expression using the Closest Point function.
However, these QGIS features need to be invoked manually, and I was hoping that these functions (or a similar one) could somehow be called using a Python script from within QGIS. Maybe someone with knowledge of QGIS internal functions can advice on how these functions can be called.