This article introduces PyRaysum, a Python software for modeling ray-theoretical body-wave propagation in dipping and/or anisotropic layered media based on the popular Fortran code Raysum. We improve and expand upon Raysum in several ways: 1) we significantly reduce the overhead by avoiding I/O operations; 2) we implement automatic phase labeling to facilitate the interpretation of complex seismograms; 3) we provide the means to correct inaccuracies in the calculated amplitude of free surface reverberations. We take advantage of the modern, object-oriented Python environment to offer various classes and methods to perform receiver function calculation, filtering and plotting. PyRaysum also integrates well with NumPy and ObsPy, two standard libraries for numerical computing and seismology. PyRaysum is built in Python version 3 and requires a Fortran compiler, but otherwise runs on all platforms. The software offers a high-level, ease-of-use user interface and is equipped with complete documentation and testing as well as tutorials to reproduce published examples from the literature. Time-optimized post-processing functions allow for the straightforward and efficient incorporation of PyRaysum synthetic data into optimization or probabilistic parametric search approaches.