The normal human retina contains several classes of photosensitive cell-rods for low-light vision, three cone classes for daylight vision, and the intrinsically photosensitive retinal ganglion cells (ipRGCs) expressing melanopsin for non-image-forming functions including pupil size, melatonin suppression and circadian photoentrainment. The spectral sensitivities of the photoreceptors overlap significantly, which means that most lights will stimulate all photoreceptors, to varying degrees. The method of silent substitution is a powerful tool for stimulating individual photoreceptor classes selectively, which is useful in research and clinical settings. The main hardware requirement for silent substitution is a spectrally calibrated light stimulation system with at least as many primaries as there are photoreceptors under consideration. Device settings that will produce lights to selectively stimulate the photoreceptor(s) of interest can be found using a variety of analytic and algorithmic approaches. Here we present PySilSub (https://github.com/PySilentSubstitution/pysilsub), a novel Python package for silent substitution featuring flexible object-oriented support for individual colorimetric observer models (including human and mouse observers), multi-primary stimulation devices, and solving silent substitution problems with linear algebra and constrained numerical optimisation. The software is registered with the Python Package Index and includes example data sets from various multi-primary systems. We hope that PySilSub will facilitate the application of silent substitution in research and clinical settings.