General-relativistic coordinates transformation support

I am looking for package that supports general-relativistic coordinates transformation to Cartesian etc. I would to transform the following coordinates to Cartesian and vice versa. What will be the code if i have to do it manually?

For Kerr-Schild to Cartesian transformation i have following code:

function kerr2cart(spin,i,r,θ,ϕ,X,Y,Z)
    sθ, cθ = sincos(th)
    sϕ, cϕ = sincos(ph)
    X[i] = (rr*cϕ + spin*sϕ) * sθ
    Y[i] = (rr*sϕ - spin*cϕ) * sθ
    Z[i] = rr * cθ
end