def to_sqla(sql): tokens = sqlparse.parse(sql)[0].tokens tokens = remove_whitespace(tokens) return tokens_to_sqla(tokens).render()