I can write to a file using yaml.dump but how do I write to a string?
yaml.dump
I have found the solution. Its an overloaded function. If you don't pass the file parameter, it will output to a string.