Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions content/blog/in-defense-of-yaml/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ formats improve.
In the meantime, you can `pip install py-yaml12` and see what a modern,
spec-compliant YAML experience looks like in Python.

And if you work in R, the [`r-yaml12`](https://github.com/posit-dev/r-yaml12)
package brings the same benefits: full YAML 1.2 compliance, Rust-backed
performance, and safe defaults. Everything good about the Python package
is in the R version as well.


[^1]: Wikipedia, "[INI file](https://en.wikipedia.org/wiki/INI_file)".

[^2]: Douglas Crockford, "[The JSON
Expand Down
4 changes: 2 additions & 2 deletions content/blog/in-defense-of-yaml/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ What has been missing from this landscape is a library that is fast, fully 1.2-c

The [`py-yaml12`](https://github.com/posit-dev/py-yaml12) library is a YAML 1.2 parser and formatter for Python, implemented in Rust for speed and correctness. It is built on the `saphyr` crate[^14] (a Rust YAML library) and exposes a minimal, focused API: `parse_yaml()` and `read_yaml()` for loading, `format_yaml()` and `write_yaml()` for serialization.

<!-- There is also a sibling [`yaml12`](https://github.com/posit-dev/r-yaml12) package for R, built on the same Rust core. -->

### Simple

The design philosophy is straightforward. For the vast majority of use cases, you work with plain Python builtins end to end: `dict`, `list`, `int`, `float`, `str`, and `None`. There is no special document class, no custom node types in the common path. Because YAML 1.2 is a superset of JSON, all valid JSON parses identically. The library achieves 100% compliance with the yaml-test-suite,[^15] the community-maintained corpus of edge cases and conformance tests.
Expand Down Expand Up @@ -282,6 +280,8 @@ This is, in the end, a familiar pattern in computing. Every generation of config

In the meantime, you can `pip install py-yaml12` and see what a modern, spec-compliant YAML experience looks like in Python.

And if you work in R, the [`r-yaml12`](https://github.com/posit-dev/r-yaml12) package brings the same benefits: full YAML 1.2 compliance, Rust-backed performance, and safe defaults. Everything good about the Python package is in the R version as well.

[^1]: Wikipedia, "[INI file](https://en.wikipedia.org/wiki/INI_file)".

[^2]: Douglas Crockford, "[The JSON Saga](https://www.youtube.com/watch?v=-C-JoyNuQJs)", presentation at Yahoo, 2011.
Expand Down
Loading