added metric api to python plugin