I've discovered YAML recently and it has turned out to be a fantastic format for my project (I'm creating a text-based RPG). It's handling everything I need flawlessly - area files (rooms with descs, exits, objs, npcs, etc), script files, npc files, object files... it tackles them all! There's just one thing...

When updating values in these files I of course need to write them back to disk to keep the changes. Unfortunately YAML's `dump()` method really makes a mess of things. First it alphabetizes all the keys, and then it appears to put one k:v pair per line. This effectively took a file with 5 lines and turned it into 94 lines.

I've tried writing the YAML objects back to disk using `write()` but it throws

> 
> TypeError: expected a character buffer object
> 
> 
> 

at me. Pickle would save it, but I think that would destroy the YAML-ness of the data. Is there a good way to save a YAML object without `dump()`? I've heard mention of SQLite, would that work the same as YAML? I have little to no database experience but it seems like YAML objects are basically databases. Would it be worth re-coding everything to use SQLite? Is it easy to save changed values with it, unlike the problem I have having now?

Any assistance here would be great. I love YAML a lot. I struggled for a long time trying to find a way to store all the data I need for my game and when I found YAML it was as if it glowed with holy light as a chorus of angels sang their glory upon it - so you can understand if I'd first like to know of a way to save YAML data to disk without using `dump()`. If not, suggestions are appreciated!