P4 is a Python package for maximum likelihood and Bayesian analysis of molecular sequences.