I am trying to find a function to have python automatically convert a string to the "simplest" type. Some examples:
conversion_function("54") -> returns an int 54
conversion_function("6.34") -> returns a float 6.34
conversion_function("False") -> returns a boolean False
conversion_function("text") -> returns a str "text"
R has a function called type.convert that does this. What is the way to do this in python? Is there an existing function or does one need to create a custom one?