Symbolic computation libraries for Python are lacking - there's SymPy, but it can throw a "NotImplementedException" at you if you try processing some more hairy formulas... Would be great if SymPy was improved.
Have you looked into SageMath? (Technically it's "Python-based" rather than "just" Python.) I'm also curious if you're specifically looking for something in Python, or if doing symbolic computation/computer algebra in other languages would work for you, barring license costs.
I needed a Python function which computes a (symbolic) derivative of a certain known formula. I could've just computed the derivative in say Mathematica, and then write the Python function manually based on the derived formula, but the derivative function had hundreds of terms and there was no way I'd transpile it manually without introducing errors.
In the end, I used a hacky Mathematica script which converts a resulting Mathematica formula into a Python code (which I then pasted into my program). But, if SymPy was better, I could do all this in just Python.
BTW, according to Wikipedia, SageMath is just using SymPy for calculus.