A summary of data about the Ruby ecosystem.

https://github.com/ruby/psych

A libyaml wrapper for Ruby
https://github.com/ruby/psych

Keywords

c hacktoberfest java libyaml psych ruby yaml-parser

Keywords from Contributors

rubygems activerecord activejob mvc rack ruby-gem json-parser documentation-tool sinatra repl

Last synced: about 6 hours ago
JSON representation

Repository metadata

A libyaml wrapper for Ruby

README.md

Psych

Description

Psych is a YAML parser and emitter. Psych leverages
libyaml for its YAML parsing and emitting
capabilities. In addition to wrapping libyaml, Psych also knows how to
serialize and de-serialize most Ruby objects to and from the YAML format.

Examples

# Safely load YAML in to a Ruby object
Psych.safe_load('--- foo') # => 'foo'

# Emit YAML from a Ruby object
Psych.dump("foo")     # => "--- foo\n...\n"

Dependencies

  • libyaml
  • libfyaml (optional, only for the experimental --enable-libfyaml backend)

Installation

Psych has been included with MRI since 1.9.2, and has been the default YAML parser
since 1.9.3.

If you want a newer gem release of Psych, you can use RubyGems:

gem install psych

Psych supported the static build with specific version of libyaml sources. You can build psych with libyaml-0.2.5 like this.

gem install psych -- --with-libyaml-source-dir=/path/to/libyaml-0.2.5

In order to use the gem release in your app, and not the stdlib version,
you'll need the following:

gem 'psych'
require 'psych'

Or if you use Bundler add this to your Gemfile:

gem 'psych'

JRuby ships with a pure Java implementation of Psych.

Experimental libfyaml backend

Psych ships an experimental, opt-in backend built on
libfyaml, a fully YAML 1.2 compliant
parser and emitter. It is compiled only when you explicitly pass
--enable-libfyaml at build time. Without the flag the default libyaml
backend is used and nothing changes.

# libfyaml and pkg-config must be installed first, for example:
#   apt-get install libfyaml-dev   # Debian/Ubuntu
#   brew install libfyaml          # macOS
gem install psych -- --enable-libfyaml

This backend is not supported on Windows.

Because libfyaml follows YAML 1.2, the YAML 1.1 booleans yes, no, on, and
off load as plain strings instead of true/false (only true/false are
booleans). This resolves the so-called "Norway problem", where the country
code no was parsed as false:

Psych.load("country: no") # => {"country" => "no"}

You can check which backend is active:

Psych::BACKEND         # => "libfyaml" (or "libyaml")
Psych.libfyaml_version # => "0.9.6"

The backend is experimental. Its output is valid YAML but is formatted
differently from libyaml in places, and a few emitter edge cases are not yet
matched. The default libyaml backend remains the supported choice.

Two more differences are worth knowing. Scalars emitted with the default
(ANY) style may be quoted or laid out differently from libyaml, so
byte-for-byte output is not guaranteed to match. On a parse error,
Psych::SyntaxError#problem carries libfyaml's full diagnostic message and
Psych::SyntaxError#context is always nil, whereas libyaml splits the
description across #problem and #context.

This backend targets YAML 1.2 compliance, not speed. In a rough
single-machine benchmark that loads and dumps in-memory documents, parsing
was roughly on par with libyaml (sometimes faster on string-heavy input),
while emitting was about 1.7x to 1.9x slower. Your numbers will vary, but the
shape holds: libfyaml is competitive at parsing and slower at emitting. Use
this backend when you need YAML 1.2 semantics. If throughput is your priority,
keep using the default libyaml backend.

Release

We used the trusted publisher and rubygems/release-gem workflow.

We can release the new version with:

git tag vXXX && git push origin vXXX

License

Copyright 2009 Aaron Patterson, et al.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 1,233
Total Committers: 124
Avg Commits per committer: 9.944
Development Distribution Score (DDS): 0.65

Commits in past year: 85
Committers in past year: 14
Avg Commits per committer in past year: 6.071
Development Distribution Score (DDS) in past year: 0.6

Name Email Commits
Aaron Patterson a****n@g****m 432
Hiroshi SHIBATA h****t@r****g 339
Charles Oliver Nutter h****s@h****m 74
Nobuyoshi Nakada n****u@r****g 49
dependabot[bot] 4****] 40
Jean Boussier j****r@g****m 22
Marcus Stollsteimer s****r@w****e 14
Alexander Momchilov a****v@s****m 12
Yusuke Endoh m****e@r****g 11
Benoit Daloze e****p@g****m 10
Zachary Scott z****y@z****t 10
MSP-Greg M****g 8
John Barnette j****e@g****m 8
David Rodríguez d****z@r****t 7
Peter Zhu p****r@p****a 7
OrenGitHub t****u@g****m 6
Marc-Andre Lafortune g****b@m****a 6
Leonard Chin l****n@g****m 6
nick evans n****k@r****v 5
Greg Houle g****e@s****m 5
kazu k****u@b****e 5
Jakub Jirutka j****b@j****z 5
kares s****f@k****g 5
Kevin Menard n****m@g****m 5
Alexandr Opak o****r@g****m 4
Takashi Kokubun t****n@g****m 4
Eric Hodel d****n@s****t 4
Jun Aruga j****a@r****m 3
Olle Jonsson o****n@g****m 3
S.H g****7@g****m 3
and 94 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 129
Total pull requests: 197
Average time to close issues: over 2 years
Average time to close pull requests: about 2 months
Total issue authors: 115
Total pull request authors: 56
Average comments per issue: 4.33
Average comments per pull request: 1.24
Merged pull request: 157
Bot issues: 1
Bot pull requests: 43

Past year issues: 8
Past year pull requests: 51
Past year average time to close issues: 5 days
Past year average time to close pull requests: 8 days
Past year issue authors: 7
Past year pull request authors: 20
Past year average comments per issue: 1.25
Past year average comments per pull request: 0.88
Past year merged pull request: 34
Past year bot issues: 0
Past year bot pull requests: 22

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ruby/psych

Top Issue Authors

  • headius (7)
  • jeremy (2)
  • tdeo (2)
  • abitrolly (2)
  • ciscolive (2)
  • rubyFeedback (2)
  • MSP-Greg (2)
  • dentarg (2)
  • poloka (2)
  • josh-wise-proof (1)
  • stevecheckoway (1)
  • wscourge (1)
  • joallard (1)
  • jsvd (1)
  • shyouhei (1)

Top Pull Request Authors

  • dependabot[bot] (43)
  • hsbt (27)
  • nobu (16)
  • headius (10)
  • peterzhu2118 (10)
  • casperisfine (8)
  • chadlwilson (5)
  • amomchilov (5)
  • tenderlove (4)
  • kares (3)
  • nevans (3)
  • etiennebarrie (3)
  • byroot (3)
  • runephilosof (3)
  • jjb (2)

Top Issue Labels

  • JRuby (6)
  • Documentation (2)
  • dependencies (1)

Top Pull Request Labels

  • dependencies (43)
  • github_actions (31)
  • Documentation (1)

Package metadata

gem.coop: psych

Psych is a YAML parser and emitter. Psych leverages libyaml[https://pyyaml.org/wiki/LibYAML] for its YAML parsing and emitting capabilities. In addition to wrapping libyaml, Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.

  • Homepage: https://github.com/ruby/psych
  • Documentation: http://www.rubydoc.info/gems/psych/
  • Licenses: MIT
  • Latest release: 5.4.0 (published 3 months ago)
  • Last Synced: 2026-08-16T09:31:27.368Z (1 day ago)
  • Versions: 155
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 236,097,685 Total
  • Docker Downloads: 4,906,070,042
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.052%
    • Downloads: 0.157%
  • Maintainers (3)
ubuntu-23.10: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Licenses: mit
  • Latest release: 5.0.2-1build1 (published 6 months ago)
  • Last Synced: 2026-03-13T19:24:33.631Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.446%
    • Forks count: 0.626%
    • Stargazers count: 1.158%
rubygems.org: psych

Psych is a YAML parser and emitter. Psych leverages libyaml[https://pyyaml.org/wiki/LibYAML] for its YAML parsing and emitting capabilities. In addition to wrapping libyaml, Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.

  • Homepage: https://github.com/ruby/psych
  • Documentation: http://www.rubydoc.info/gems/psych/
  • Licenses: MIT
  • Latest release: 5.4.0 (published 3 months ago)
  • Last Synced: 2026-08-16T09:31:28.499Z (1 day ago)
  • Versions: 158
  • Dependent Packages: 254
  • Dependent Repositories: 11,869
  • Downloads: 236,097,685 Total
  • Docker Downloads: 4,906,070,042
  • Rankings:
    • Docker downloads count: 0.001%
    • Dependent packages count: 0.158%
    • Dependent repos count: 0.315%
    • Downloads: 0.385%
    • Average: 0.856%
    • Forks count: 1.866%
    • Stargazers count: 2.412%
  • Maintainers (3)
proxy.golang.org: github.com/ruby/psych

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/ruby/psych#section-documentation
  • Licenses: mit
  • Latest release: v5.4.0+incompatible (published 3 months ago)
  • Last Synced: 2026-08-16T09:31:29.457Z (1 day ago)
  • Versions: 70
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 1.895%
    • Stargazers count: 2.551%
    • Average: 6.206%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
ubuntu-20.04: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Licenses: mit
  • Latest release: 3.1.0+really3.1.0-1build6 (published 6 months ago)
  • Last Synced: 2026-03-13T14:27:58.011Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Licenses: mit
  • Latest release: 5.0.2-1build1 (published 6 months ago)
  • Last Synced: 2026-03-12T07:02:14.023Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Licenses: mit
  • Latest release: 5.0.2-2build2 (published 6 months ago)
  • Last Synced: 2026-03-06T16:03:50.669Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
debian-13: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Documentation: https://packages.debian.org/trixie/ruby-psych
  • Licenses: mit
  • Latest release: 5.0.2-3 (published 6 months ago)
  • Last Synced: 2026-03-14T18:11:04.958Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Licenses: mit
  • Latest release: 5.0.2-3 (published 6 months ago)
  • Last Synced: 2026-03-13T17:13:05.472Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-10: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Documentation: https://packages.debian.org/buster/ruby-psych
  • Licenses: mit
  • Latest release: 3.1.0-1 (published 6 months ago)
  • Last Synced: 2026-03-13T19:05:10.194Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
guix: ruby-psych

Ruby YAML parser and emitter

gentoo-portage: dev-ruby/psych

A YAML parser and emitter

  • Homepage: https://github.com/ruby/psych
  • Documentation: https://packages.gentoo.org/packages/dev-ruby/psych
  • Licenses: BSD-2
  • Latest release: 5.3.1 (published 4 months ago)
  • Last Synced: 2026-05-27T02:48:55.468Z (3 months ago)
  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-psych

  • Homepage: https://github.com/ruby/psych
  • Documentation: https://packages.debian.org/bookworm/ruby-psych
  • Licenses: mit
  • Latest release: 5.0.2-1 (published 6 months ago)
  • Last Synced: 2026-03-13T15:47:51.872Z (5 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

Gemfile rubygems
  • rake-compiler >= 0.4.1 development
  • ruby-maven >= 0 development
  • test-unit >= 0 development
psych.gemspec rubygems
  • jar-dependencies >= 0.1.7
  • stringio >= 0
.github/workflows/libyaml.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby-pkgs v1 composite
.github/workflows/push_gem.yml actions
  • actions/checkout 8e8c483db84b4bee98b60c0593521ed34d9990e8 composite
  • ruby/setup-ruby d5126b9b3579e429dd52e51e68624dda2e05be25 composite
  • rubygems/release-gem 1c162a739e8b4cb21a676e97b087e8268d8fc40b composite
  • step-security/harden-runner 20cf305ff2072d973412fa9b1e3a4f227bda3c76 composite
.github/workflows/sync-ruby.yml actions
  • actions/checkout v6.0.1 composite
  • actions/create-github-app-token v2 composite
  • convictional/trigger-workflow-and-wait v1.6.5 composite

Score: 34.41086320200579