Thanks for your repo. Here is something you could add. The Fortran code
write (*,"(a)") "'" // trim(" ab ") // "'"
write (*,"(a)") "'" // trim(adjustl(" ab ")) // "'"
end
is equivalent to Python code
print("'" + " ab ".rstrip() + "'")
print("'" + " ab ".strip() + "'")
so in short, trim(s) in Fortran is equal to s.rstrip() in Python, and trim(adjustl(s)) equals s.strip()