We present a general theory for predicting the interaction potentials between DNA-coated colloids, and more broadly, any particles that interact via valence-limited ligand-receptor binding. Our theory correctly incorporates the configurational and combinatorial entropic factors that play a key role in valence-limited interactions. By rigorously enforcing self-consistency, it achieves near-quantitative accuracy with respect to detailed Monte Carlo calculations. With suitable approximations and in particular geometries, our theory reduces to previous successful treatments, which are now united in a common and extensible framework. We expect our tools to be useful to other researchers investigating ligand-mediated interactions. A complete and well-documented Python implementation is freely available at http://github.com/patvarilly/DNACC .