ssato / python-anyconfig

Python library provides common APIs to load and dump configuration files in various formats
MIT License
278 stars 31 forks source link

The order of items are not kept in YAML backend #38

Closed ssato closed 7 years ago

ssato commented 8 years ago

It's possible but not easy to keep items load from YAML files. see:

AnkurDedania commented 8 years ago

Possibly use rtyaml instead of pyyaml to preserve order and comments. rtyaml builds on top of pyyaml.

ssato commented 8 years ago

Thanks a lot for your info! I was not aware of rtyaml. It feels promising in various point of views and I will look into it.

ssato commented 7 years ago

The commit 76508b7 and related ones improved and fixed this and now we can load YAML files with the order of items kept.

AnkurDedania commented 7 years ago

update, I would reconsider now with ruamel.yaml. Supports the latest YAML 1.2 standard unlike PyYAML.

ssato commented 7 years ago

@AnkurDedania Thanks a lot! I'll look into it also.

ssato commented 7 years ago

@AnkurDedania Just FYI. I changed the yaml backend to use ruamel.yaml instead of PyYAML if it's available: 551c0fd