python ph package wip + bug fixes