def parse_str(s):
    """Try to parse a string to int, then float, then bool, then leave alone"""
    try:
        return int(s)
    except ValueError:
        try:
            return float(s)
        except ValueError:
            if s.lower() == 'true':
                return True
            if s.lower() == 'false':
                return False
            return s