sql formatting in .py files

Is there a way that I can apply the SQL formatter to strings in python scripts? I am thinking some kind of directive that says this string is sql. I have a lot of pyspark scripts that have SQL in them, and would like to use formatting on them.