You can certainly build models like this pretty easily in PyMC3. I use them frequently in my applied work.