Galaxy cluster analyses based on high-resolution observations of the Sunyaev-Zeldovich (SZ) effect have become common in the last decade. We present PreProFit, the first publicly available code designed to fit the pressure profile of galaxy clusters from SZ data. PreProFit is based on a Bayesian forward-modelling approach, allows the analysis of data coming from different sources, adopts a flexible parametrization for the pressure profile, and fits the model to the data accounting for Abel integral, beam smearing, and transfer function filtering. PreProFit is computationally efficient, is extensively documented, has been released as an open source Python project, and was developed to be part of a joint analysis of X-ray and SZ data on galaxy clusters. PreProFit returns $chi^2$, model parameters and uncertainties, marginal and joint probability contours, diagnostic plots, and surface brightness radial profiles. PreProFit also allows the use of analytic approximations for the beam and transfer functions useful for feasibility studies.