Is there a way to obtain the transfer function from a bode plot on Python? (I know that it is possible on Matlab)
Yes, use the control toolbox that is available in python. You can install it using pip install control

From here you can implement transfer functions, bode plots, step responses etc similar to what you would be accustomed to doing with the Matlab control toolbox.

Here are further details:

https://github.com/python-control/python-control