{"id":33907045,"url":"https://github.com/posit-dev/r-yaml12","last_synced_at":"2026-03-13T14:32:05.560Z","repository":{"id":326140041,"uuid":"1097421779","full_name":"posit-dev/r-yaml12","owner":"posit-dev","description":"Modern YAML 1.2 parser/emitter for R, written in Rust","archived":false,"fork":false,"pushed_at":"2025-12-30T15:52:05.000Z","size":17686,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T09:24:48.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://posit-dev.github.io/r-yaml12/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posit-dev.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-16T06:19:30.000Z","updated_at":"2025-12-30T15:46:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/posit-dev/r-yaml12","commit_stats":null,"previous_names":["t-kalinowski/r-yaml12"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/posit-dev/r-yaml12","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fr-yaml12","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fr-yaml12/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fr-yaml12/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fr-yaml12/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/r-yaml12/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fr-yaml12/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30468295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-12T02:22:57.373Z","updated_at":"2026-03-13T14:32:05.546Z","avatar_url":"https://github.com/posit-dev.png","language":"Rust","readme":"---\noutput: github_document\neditor_options:\n  markdown:\n    wrap: 72\n    canonical: true\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# yaml12 \u003ca href=\"https://posit-dev.github.io/r-yaml12/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"136\" alt=\"yaml12 website\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![R-CMD-check](https://github.com/posit-dev/r-yaml12/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/posit-dev/r-yaml12/actions/workflows/R-CMD-check.yaml)\n\n\u003c!-- badges: end --\u003e\n\nA YAML 1.2 parser/formatter for R, implemented in Rust for speed and\ncorrectness. Built on the excellent\n[`saphyr`](https://github.com/saphyr-rs/saphyr) crate.\n\n## Installation\n\nYou can install yaml12 from CRAN with:\n\n``` r\ninstall.packages(\"yaml12\")\n```\n\nYou can install the development version of yaml12 from\n[GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"posit-dev/r-yaml12\")\n```\n\n## Quick start\n\n```{r}\nlibrary(yaml12)\n\nyaml \u003c- \"\ntitle: A modern YAML parser and emitter written in Rust\nproperties: [fast, correct, safe, simple]\nsequences:\n  simplify: true\n\"\n\ndoc \u003c- parse_yaml(yaml)\nstr(doc)\n```\n\n### Reading and writing files\n\n```{r}\nvalue_out \u003c- list(alpha = 1L, nested = c(TRUE, NA))\n\nwrite_yaml(value_out, \"my.yaml\")\nvalue_in \u003c- read_yaml(\"my.yaml\")\n\nstopifnot(identical(value_out, value_in))\n\n# Multi-document streams\ndocs_out \u003c- list(list(foo = 1L), list(bar = c(2L, NA)))\n\nwrite_yaml(docs_out, \"my-multi.yaml\", multi = TRUE)\ndocs_in \u003c- read_yaml(\"my-multi.yaml\", multi = TRUE)\n\nstopifnot(identical(docs_in, docs_out))\n```\n\n```{r, echo = FALSE}\nunlink(c(\"my.yaml\", \"my-multi.yaml\"))\n```\n\n### Tag handlers\n\nHandlers let you opt into custom behavior for tagged nodes while keeping\nthe default parser strict and safe.\n\n```{r}\nyaml \u003c- \"\n- !upper [rust, r]\n- !expr 6 * 7\n\"\n\nhandlers \u003c- list(\n  \"!expr\"  = function(x) eval(str2lang(x), baseenv()),\n  \"!upper\" = toupper\n)\n\nparse_yaml(yaml, handlers = handlers)\n```\n\n### Non-string mapping keys\n\nYAML mappings can use keys that R cannot store directly as names (for\nexample, booleans, numbers, or tagged strings). When that happens,\n`parse_yaml()` still returns a named list but also attaches a\n`yaml_keys` attribute containing the original YAML keys:\n\n```{r}\nyaml \u003c- \"\ntrue: a\nnull: b\n!custom foo: c\n\"\n\nparsed \u003c- parse_yaml(yaml)\n\nstopifnot(identical(\n  parsed,\n  structure(\n    list(\"a\", \"b\", \"c\"),\n    names = c(\"\", \"\", \"\"),\n    yaml_keys = list(TRUE, NULL, structure(\"foo\", yaml_tag = \"!custom\"))\n  )\n))\n```\n\n### Formatting and round-tripping\n\nThe `yaml_tag` and `yaml_keys` attributes are also hooks for customizing\noutput: tags on values round-trip, and `yaml_keys` allows you to emit\nmappings with non-string or tagged keys that can’t be represented as an\nR name.\n\n```{r}\nobj \u003c- list(\n  seq = 1:2,\n  map = list(key = \"value\"),\n  tagged = structure(\"1 + 1\", yaml_tag = \"!expr\"),\n  keys = structure(\n    list(\"a\", \"b\", \"c\"),\n    names = c(\"plain\", \"\", \"\"),\n    yaml_keys = list(\"plain\", TRUE, structure(\"foo\", yaml_tag = \"!custom\"))\n  )\n)\n\nyaml \u003c- format_yaml(obj)\ncat(yaml)\n\nroundtripped \u003c- parse_yaml(yaml)\nidentical(obj, roundtripped)\n```\n\n## Documentation\n\n-   YAML quick primer:\n    \u003chttps://posit-dev.github.io/r-yaml12/articles/yaml-2-minute-intro.html\u003e.\n-   Tags, handlers, anchors, and advanced YAML features:\n    \u003chttps://posit-dev.github.io/r-yaml12/articles/yaml-tags-and-advanced-features.html\u003e.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fr-yaml12","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fr-yaml12","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fr-yaml12/lists"}