ruyaml is a fork of ruamel.yaml, a YAML parser and emitter for Python that aims to preserve comments, order, and other structural details during round-trip loading and dumping. It is actively maintained, with version 0.91.0 being the latest stable release, and receives updates periodically, often merging upstream changes from `ruamel.yaml`.
pip install ruyamlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load and dump YAML data while preserving comments, ordering, and block/flow styles using `ruyaml`'s default `YAML()` instance for round-trip parsing.
Change `pip install ruamel.yaml` to `pip install ruyaml` and `from ruamel.yaml import ...` to `from ruyaml import ...`.
If simpler loading/dumping is desired, explicitly specify `typ='safe'` or `typ='unsafe'`. For example: `yaml = YAML(typ='safe')`. Be aware this will lose round-trip preservation capabilities.
To control string quoting, use `yaml.indent(mapping=X, sequence=Y, offset=Z)`. To force flow style for collections, use `yaml.default_flow_style = True` or explicitly set `yaml.Representer.add_representer` for custom types. For specific string issues, `yaml.scalar_string = True` might help.
No dependency data recorded yet.