Saving order in ruamel.yaml

884 views Asked by At

I was able to save SQL in beauty way based on question Save SQL to YAML as is.

Now, I should resolve issue with saving order in YAML as was before loading. So, I had YAML config as:

app:
  ....
conf:
  sql:
    ....
  mapping:
    ....
filters:
  ....

Once I save with ruamel.yaml I got random order saving as example below:

filters:
  ....
conf:
  mapping:
    ....
  sql:
    ....
app:
  ....

How can I save the keys of YAML-file as was loaded?

Solution: https://stackoverflow.com/a/30763929/4437954

0

There are 0 answers