I have a yaml file that looks like this:
# The following key opens a door
key: value
Is there a way I can load
and dump<
I have a branch of pyyaml that does exactly this. https://github.com/pflarr/pyyaml
To build a yaml file with comments, you have to create an event stream that includes comment events. Comments are currently only allowed before sequence items and mapping keys.
This only currently works for python3, I haven't ported it to the python2 version of the library, but could easily do so on request. Additionally, this should also be fairly easy to port to the C libyaml as well, as the python code is a simple port of that anyway.