PyDDRBG is a Python framework for generating tunable test problems for static and dynamic multimodal optimization. It allows for quick and simple generation of a set of predefined problems for non-experienced users, as well as highly customized problems for more experienced users. It easily integrates with an arbitrary optimization method. It can calculate the optimization performance when measured according to the robust mean peak ratio. PyDDRBG is expected to advance the fields of static and dynamic multimodal optimization by providing a common platform to facilitate the numerical analysis, evaluation, and comparison in these fields.