Skip to content

yaml12

0.2.0Package record

Fast 'YAML' 1.2 Parser and Formatter

2packages dependsuggested by 1
11.4Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

A fast, correct, safe, and ergonomic 'YAML' 1.2 parser and generator written in 'Rust'. Convert between 'YAML' and simple 'R' objects with full support for multi-document streams, tags, anchors, and aliases. Offers opt-in handlers for custom tag behavior and round-trips common 'R' data structures. Implements the 'YAML' 1.2.2 specification from the 'YAML' Language Development Team (2021) https://yaml.org/spec/1.2.2/. Proudly supported by Posit.

Changes in 0.2.0
  • The parser now accepts and ignores reserved directives such as %*** and treats indented --- text as part of a multiline plain scalar.
  • parse_yaml() and read_yaml() now preserve tags in the tag:yaml.org,2002: namespace that are not converted to built-in R values as a yaml_tag attribute.
  • parse_yaml() now invokes mapping-key handlers once per key.
  • write_yaml() no longer adds optional document end (...) markers. Written documents still begin with --- and end with a newline.
  • format_yaml() and write_yaml() now emit Inf, -Inf, and NaN as .Inf, -.Inf, and .NaN so they round-trip as doubles (#9).
  • write_yaml() gains an append argument for adding YAML documents to existing files (#4).
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
  • Replaced the Rust-side R API layer with savvy/savvy-ffi bindings. Source installs now require rustc 1.71 or newer. Vendored Rust crate attribution now points to crate repository metadata when Cargo does not provide crate authors.
  • format_yaml() and write_yaml() now emit whole-valued doubles with a decimal suffix (for example, 100.0 instead of 100), so parsing the result preserves their R double type.
  • format_yaml() and write_yaml() now automatically wrap long single-line strings and multiline strings containing unindented, single-line paragraphs separated by exactly one blank line. Strings with a safe word boundary are emitted as folded block scalars: >- preserves no final newline, while > preserves exactly one. Paragraph breaks and all other string content round-trip through parse_yaml() unchanged. The new width argument controls the target line width; width = NULL and width = Inf disable folded wrapping, mapping keys never use block scalars, and unsafe values use a lossless fallback. Mapping keys longer than YAML's implicit-key limit use explicit mapping syntax.
  • Multiline literal blocks now use explicit indentation indicators to preserve leading spaces or tabs. They keep physical blank lines empty and preserve later-indented lines. Root literal content is indented so document markers inside a string cannot end the scalar.
  • format_yaml() and write_yaml() now quote strings only when YAML 1.2 requires it. Strings such as "yes", "don't", "a,b", "f[0]", or ".gitignore" are emitted as plain scalars (YAML 1.2 has no legacy yes/no/on/off booleans, and indicator characters only need quoting in positions where they are ambiguous). Strings the YAML 1.2 core schema would read back as null, boolean, or a number (e.g. "true", "0x1F", "0o17", ".inf") are still quoted, as are structurally unsafe ones (leading indicators, ": ", " #", leading/trailing white space, or document-marker prefixes).
  • read_yaml() and write_yaml() now expand tilde prefixes (~) in path, as by path.expand() (#7).
  • Fixed source installs on Windows ARM64 by selecting the aarch64-pc-windows-gnullvm Rust target. Windows source installs now also fail early with instructions if the required Rust target is not installed. The README documents that Windows ARM64 source installs also require Microsoft C++ Build Tools with ARM64 components.
  • Added a benchmarks article comparing read/write performance against the yaml package (#2).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.7 min · r-release-macos-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-30
  • NOTE12 OK, 1 NOTE2026-07-29
  • OK13 OK2026-05-02
Show 4 earlier changesHide 4 earlier changes
  • NOTE11 OK, 1 NOTE2026-04-25
  • OK14 OK2026-04-16
  • NOTE13 OK, 1 NOTE2026-03-28
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 284 wordsVignettesYes · 2 · dynamicNEWSYes · 100% structured · mentions 0.2.0Citation fileNoWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
2
Examples that run
100%2 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

11.4K
CRAN downloads in the past year
Rank #2,936 · ~31/day · ~951/mo
Daily download trend is not available in this view yet.
1.8K30 days
4.8K90 days
11.4K1 year
Compare downloads with other packages →
Also on623 r2u

Repository

27Stars
1Forks
3Open issues
0Open PRs
2Releases
187Commits
2Commit identities
187 commits · Last activity 2026-08-26 · +8% stars, 30d · Default branch at 0.2.0.9000, ahead of CRAN 0.2.0 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
56
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-11-25 · 12026-10-12 · 27
PracticesBeta

8 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/posit-dev/r-yaml12 on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-08-26 · The repository has a site deploy workflow

pkgdown site last built 2026-08-25

CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

An outside contributor's pull request to this repository was written with an AI coding tool.

From outside contributors
  • Claude Code
    Pull requests: 1 from outside contributors, first on 2026-07-07, 1 from forks
How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
6 external dependencies (excludes base and recommended)

Installing yaml12 adds no packages beyond those that come with R.

Depends (1)
R >= 4.2
Imports (0)
none
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
2direct
1indirect
Imports 2
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (3)
Author, Maintainer since 0.1.0 (2025)
Copyright holder
See inst/AUTHORS and LICENSE.note for vendored Rust dependency authors and licenses.
Copyright holder, Funder
Releases (2)

Pick two releases to compare their code metrics.

  • 0.2.0Latest
    record
    2026-08-25 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.0
    record
    2025-12-11
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-12-11
Total releases
2 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.2
Download size
1.6 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("yaml12")
Kalinowski, T., Authors of the dependency Rust crates, & Posit Software, PBC. (2026). yaml12: Fast 'YAML' 1.2 Parser and Formatter (Version 0.2.0) [Computer software]. https://doi.org/10.32614/CRAN.package.yaml12

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for yaml12 version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy