0

have gone through link1link2, but the solution is not working for me.

I have an input YAML file, which contains data in both plain style as well as double-quoted style format. I need to update this YAML base on some logic and save it without any other changes.

Single quote data should remain, single quote and Double Quote to remain double quote, so that when we do git diff, it just shows the logical change.

Current issue: When I am doing yaml.dump(changes, file, default_style=None), it is converting plain style to double-quoted style in output file !

Any leads will be very helpful.

abhilash_goyal
  • 621
  • 1
  • 10
  • 24
  • Does this answer your question? [I want to load a YAML file, possibly edit the data, and then dump it again. How can I preserve formatting?](https://stackoverflow.com/questions/60891174/i-want-to-load-a-yaml-file-possibly-edit-the-data-and-then-dump-it-again-how) – flyx Jun 10 '21 at 15:11

0 Answers0