You can use the sqlparse package and sqlparse.format(sql, reindent=True, keyword_case="upper"). IT should do what you want.
You can use the sqlparse package and sqlparse.format(sql, reindent=True, keyword_case="upper"). IT should do what you want.