make pyn wrapper work both through a link and directly