TLDR: You can't tell by just counting the A and D table records; you also need to know if the object was in the business (base) table as well.
Objects from the base table which have not been modified before deletion have only an entry in the deletes table (Base, Delete)
Objects which have never been posted to the base table would have the same number of ...
You can solve it using virtual layers:
I update my answer:
To create the virtual layers the supported query language is SQLite and SpatiaLite.
You can check the supported functions here.
from qgis.core import QgsVectorLayer, QgsProject
vlayer = QgsVectorLayer( "?query=SELECT * FROM Project WHERE st_distance(geometry, PointFromText('POINT (1.002 51....
Im not sure about the measurements (coordinate system in degrees, distance in meters) but the results doesnt look unreasonable:
layer = iface.activeLayer()
distance = QgsDistanceArea()