Flowsheet design and optimization constitute one of the key challenges in the chemical engineering and process optimization communities. Software tools for digital design and flowsheet simulation are readily available for traditional chemical processing problems such as distillation and hydrocarbon processing, however tools for pharmaceutical manufacturing are much less widely developed. This paper introduces, PharmaPy, a Python-based modelling platform for pharmaceutical facility design and optimization. The versatility of the platform is demonstrated in simulating both continuous and batch process flowsheets.