A summary of data about the Ruby ecosystem.

https://github.com/jmespath/jmespath.rb

Ruby implementation of JMESPath
https://github.com/jmespath/jmespath.rb

Keywords from Contributors

aws-sdk rubygems activejob activerecord mvc code-quality coverage coverage-library coverage-report test-coverage

Last synced: about 18 hours ago
JSON representation

Repository metadata

Ruby implementation of JMESPath

README.md

jmespath.rb

Gitter chat Build Status

An implementation of JMESPath for Ruby. This implementation supports searching JSON documents as well as native Ruby data structures.

Installation

$ gem install jmespath

Basic Usage

Call JMESPath.search with a valid JMESPath search expression and data to search. It will return the extracted values.

require 'jmespath'

JMESPath.search('foo.bar', { foo: { bar: { baz: "value" }}})
#=> {baz: "value"}

In addition to accessing nested values, you can exact values from arrays.

JMESPath.search('foo.bar[0]', { foo: { bar: ["one", "two"] }})
#=> "one"

JMESPath.search('foo.bar[-1]', { foo: { bar: ["one", "two"] }})
#=> "two"

JMESPath.search('foo[*].name', {foo: [{name: "one"}, {name: "two"}]})
#=> ["one", "two"]

If you search for keys no present in the data, then nil is returned.

JMESPath.search('foo.bar', { abc: "mno" })
#=> nil

See the JMESPath specification for a full list of supported search expressions.

Indifferent Access

The examples above show JMESPath expressions used to search over hashes with symbolized keys. You can use search also for hashes with string keys or Struct objects.

JMESPath.search('foo.bar', { "foo" => { "bar" => "value" }})
#=> "value"

data = Struct.new(:foo).new(
  Struct.new(:bar).new("value")
)
JMESPath.search('foo.bar', data)
#=> "value"

JSON Documents

If you have JSON documents on disk, or IO objects that contain JSON documents, you can pass them as the data argument.

JMESPath.search(expression, Pathname.new('/path/to/data.json'))

File.open('/path/to/data.json', 'r', encoding:'UTF-8') do |file|
  JMESPath.search(expression, file)
end

Links of Interest

License

This library is distributed under the apache license, version 2.0

Copyright 2014 Trevor Rowe; All rights reserved.

Licensed under the apache license, version 2.0 (the "license");
You may not use this library except in compliance with the license.
You may obtain a copy of the license at:

http://www.apache.org/licenses/license-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the license is distributed on an "as is" basis,
without warranties or conditions of any kind, either express or
implied.

See the license for the specific language governing permissions and
limitations under the license.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 231
Total Committers: 23
Avg Commits per committer: 10.043
Development Distribution Score (DDS): 0.411

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Trevor Rowe t****e@g****m 136
Theo t****o@i****t 52
Alex Woods a****o@a****m 9
Matt Muller m****r@a****m 8
Mac Tichner m****r@m****m 4
Geophilus Durairaj g****j@f****m 3
David Dahl d****d@b****m 2
Erik Michaels-Ober s****k@g****m 2
Christopher Geers c****s@c****o 1
Chris Roberts c****e@c****g 1
Ethan 1****n 1
František Dvořák v****i@c****z 1
Gustav Munkby g****v@g****m 1
James Saryerwinnie js@j****m 1
John Allen j****n@t****m 1
Kentaro Hayashi h****i@c****m 1
Kevin Deisz k****z@g****m 1
Masataka Kuwabara k****a@p****e 1
Mike Vastola m****e@v****a 1
Paul Morton p****n@b****m 1
Sten Larsson s****n@b****m 1
The Gitter Badger b****r@g****m 1
Tim Craft m****l@t****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 4 days ago

Total issues: 24
Total pull requests: 38
Average time to close issues: 7 months
Average time to close pull requests: 6 months
Total issue authors: 20
Total pull request authors: 26
Average comments per issue: 3.71
Average comments per pull request: 1.89
Merged pull request: 31
Bot issues: 0
Bot pull requests: 0

Past year issues: 1
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: 1 day
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 1.0
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0

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

Top Issue Authors

  • iconara (2)
  • elyobo (2)
  • grosser (2)
  • pmorton (2)
  • lucasluitjes (1)
  • mtasaka (1)
  • mtdowling (1)
  • MadBomber (1)
  • johnallen3d (1)
  • aerostitch (1)
  • cdenneen (1)
  • joelmichael (1)
  • valtri (1)
  • arthurnn (1)
  • DJStephan (1)

Top Pull Request Authors

  • iconara (5)
  • trevorrowe (5)
  • timcraft (2)
  • kenhys (2)
  • alextwoods (2)
  • mtichner (2)
  • grddev (1)
  • effata (1)
  • pocke (1)
  • aerostitch (1)
  • mvastola (1)
  • kddnewton (1)
  • legendetm (1)
  • stenlarsson (1)
  • sferik (1)

Top Issue Labels

  • bug (2)
  • version-2 (1)
  • enhancement (1)
  • question (1)

Top Pull Request Labels

  • enhancement (1)

Package metadata

proxy.golang.org: github.com/jmespath/jmespath.rb

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/jmespath/jmespath.rb#section-documentation
  • Licenses: apache-2.0
  • Latest release: v1.6.2 (published over 3 years ago)
  • Last Synced: 2026-02-27T22:03:16.173Z (4 days ago)
  • Versions: 20
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 3.885%
    • Stargazers count: 4.042%
    • Average: 7.076%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%

Dependencies

Gemfile rubygems
  • absolute_time >= 0 development
  • octokit >= 0 development
  • rdiscount >= 0 development
  • yard >= 0 development
  • yard-sitemap ~> 1.0 development
  • rake >= 0
  • rspec ~> 3.0
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • ruby/setup-ruby v1 composite
jmespath.gemspec rubygems

Score: -Infinity