Python library for the PHD project