i remember fabric API can be called directly in py script but forgot where to start anybody give a clue?
Yes, you can call it, for example:
from fabric.api import run
from fabric.tasks import execute
def do_something():
run("echo $RANDOM")
if __name__ == "__main__":
execute(do_something, hosts=["username@host"])