As part of the effort to meet the needs of the Large Synoptic Survey Telescope Dark Energy Science Collaboration (LSST DESC) for accurate, realistically complex mock galaxy catalogues, we have developed galsampler, an open-source python package that assists in generating large volumes of synthetic cosmological data. The key idea behind galsampler is to recast hydrodynamical simulations and semi-analytic models as physically motivated galaxy libraries. galsampler populates a new, larger volume halo catalogue with galaxies drawn from the baseline library; by using weighted sampling guided by empirical modelling techniques, galsampler inherits statistical accuracy from the empirical model and physically motivated complexity from the baseline library. We have recently used galsampler to produce the cosmoDC2 extragalactic catalogue made for the LSST DESC Data Challenge 2. Using cosmoDC2 as a guiding example, we outline how galsampler can continue to support ongoing and near-future galaxy surveys such as the Dark Energy Survey, the Dark Energy Spectroscopic Instrument, WFIRST, and Euclid.