Given a continued fraction it computes the square (I needed it for my masters thesis). I'm using the algorithm described (and proven) in: "Algebraic computations with continued fractions" by Pierre Liardet and Pierre Stambul in J. Number Theory 73 (1998), no. 1, 92-121. Can be found here: https://www.sciencedirect.com/science/article/pii/S0022314X98922740
It was my first small project on Python, so it is a little messy, but it does work. I'm planning on refining it at some point.