{"id":13509770,"url":"https://github.com/processone/fast_yaml","last_synced_at":"2025-04-07T08:29:21.986Z","repository":{"id":45408383,"uuid":"47834938","full_name":"processone/fast_yaml","owner":"processone","description":"Fast YAML native library for Erlang / Elixir","archived":false,"fork":false,"pushed_at":"2024-06-27T09:06:48.000Z","size":346,"stargazers_count":51,"open_issues_count":2,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-31T06:09:03.702Z","etag":null,"topics":["erlang","libyaml","libyaml-library","yaml"],"latest_commit_sha":null,"homepage":"http://ejabberd.im","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/processone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2015-12-11T15:40:11.000Z","updated_at":"2024-06-27T09:06:50.000Z","dependencies_parsed_at":"2024-10-30T02:28:20.375Z","dependency_job_id":null,"html_url":"https://github.com/processone/fast_yaml","commit_stats":{"total_commits":188,"total_committers":15,"mean_commits":"12.533333333333333","dds":0.7340425531914894,"last_synced_commit":"24c5e30c0d73b9ef56e575327b8c334366a345f0"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Ffast_yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Ffast_yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Ffast_yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/processone%2Ffast_yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/processone","download_url":"https://codeload.github.com/processone/fast_yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247618655,"owners_count":20967822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["erlang","libyaml","libyaml-library","yaml"],"created_at":"2024-08-01T02:01:12.780Z","updated_at":"2025-04-07T08:29:21.967Z","avatar_url":"https://github.com/processone.png","language":"Erlang","readme":"# Fast YAML\n\n[![CI](https://github.com/processone/fast_yaml/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/processone/fast_yaml/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/processone/fast_yaml/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/processone/fast_yaml?branch=master)\n[![Hex version](https://img.shields.io/hexpm/v/fast_yaml.svg \"Hex version\")](https://hex.pm/packages/fast_yaml)\n\nFast YAML is an Erlang wrapper for\n[libyaml](http://pyyaml.org/wiki/LibYAML) \"C\" library.\n\nIt is designed to be fast and efficient.\n\n## Installation\n\n### Dependencies\n\nFast YAML depends on native LibYaml library. You need development\nheaders for LibYaml library to build it.\n\nThe minimum required Erlang/OTP version is 18.0\n\n### Generic build\n\nYou can trigger build with:\n\n    ./configure \u0026\u0026 make\n\n### OSX build example\n\nYou can install LibYaml and with Homebrew:\n\n    brew install libyaml\n\nYou can then export environment variable to use LibYaml as installed\nby Homebrew, before issuing compilation commands:\n\n    export LDFLAGS=\"-L/usr/local/lib\"\n    export CFLAGS=\"-I/usr/local/include\"\n    export CPPFLAGS=\"-I/usr/local/include\"\n\n    ./configure \u0026\u0026 make\n\n## Example usage\n\n```erlang\nerl -pa ebin -pa deps/*/ebin\nErlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\n\nEshell V7.1  (abort with ^G)\n\n1\u003e application:start(fast_yaml).\nok\n\n2\u003e fast_yaml:decode(\u003c\u003c\"a: 1\\nb: -3.0\"\u003e\u003e).\n{ok,[[{\u003c\u003c\"a\"\u003e\u003e,1},{\u003c\u003c\"b\"\u003e\u003e,-3.0}]]}\n```\n\n## Option `plain_as_atom`\n\nConverts all unquoted YAML values to atoms\n\n```erlang\n3\u003e fast_yaml:decode(\u003c\u003c\"a: 1\\nb: -3.0\"\u003e\u003e, [{plain_as_atom, true}]).\n{ok,[[{a,1},{b,-3.0}]]}\n\n4\u003e fast_yaml:decode(\u003c\u003c\"a: b\\nc\"\u003e\u003e).\n{error,{scanner_error,\u003c\u003c\"could not find expected ':'\"\u003e\u003e,2,\n                      0}}.\n\n5\u003e fast_yaml:decode_from_file(\"test/test2.yml\", [plain_as_atom]).\n{ok,[[[{step,[{instrument,\u003c\u003c\"Lasik 2000\"\u003e\u003e},\n              {pulseEnergy,5.4},\n              {pulseDuration,12},\n              {repetition,1000},\n              {spotSize,\u003c\u003c\"1mm\"\u003e\u003e}]}],\n      [{step,[{instrument,\u003c\u003c\"Lasik 2000\"\u003e\u003e},\n              {pulseEnergy,5.0},\n              {pulseDuration,10},\n              {repetition,500},\n              {spotSize,\u003c\u003c\"2mm\"\u003e\u003e}]}],\n      [{step,\u003c\u003c\"id001\"\u003e\u003e}],\n      [{step,\u003c\u003c\"id002\"\u003e\u003e}],\n      [{step,\u003c\u003c\"id001\"\u003e\u003e}],\n      [{step,\u003c\u003c\"id002\"\u003e\u003e}]]]}\n```\n\n## Option `sane_scalars`\n\nConverts the following scalar values to their Erlang-native data type:\n\n`\"null\"` → `undefined`\n`\"true\"` → `true`\n`\"false\"` → `false`\n\nInteger and float values also get converted. All other scalar values\nstay binaries. Key in mappings also stay binary and never get coerced\ninto int / float / atom .\n\nAn unquoted mapping value that is an empty string gets converted into\n`undefined`. (e.g. the string `\"foo:\"` decodes as `[{\u003c\u003c\"foo\"\u003e\u003e, undefined}]`)\n\n## Option `maps`\n\nConvert YAML mappings into Erlang maps.\n\n\n```erlang\n7\u003e fast_yaml:decode(\u003c\u003c\"a: true\\nb: -3.0\\nc: string\"\u003e\u003e, [{maps, true}]).\n{ok, [#{\"a\" =\u003e \"true\", \"b\" =\u003e -3.0, \"c\" =\u003e \"string\"}]}\n```\n\n\n\u003e For compatibility with the `yamerl` and `YamlElixir` libraries, use the `[sane_scalars, maps]` options.\n\n\n## Development\n\n### Test\n\n#### Unit test\n\nYou can run eunit test with the command:\n\n    make test\n","funding_links":[],"categories":["YAML"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocessone%2Ffast_yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprocessone%2Ffast_yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprocessone%2Ffast_yaml/lists"}