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
- Host: GitHub
- URL: https://github.com/jmespath/jmespath.rb
- Owner: jmespath
- License: apache-2.0
- Created: 2014-10-01T21:20:34.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T17:42:43.000Z (about 1 year ago)
- Last Synced: 2026-02-09T00:47:06.198Z (23 days ago)
- Language: Ruby
- Size: 276 KB
- Stars: 155
- Watchers: 8
- Forks: 42
- Open Issues: 4
- Releases: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Security: SECURITY.md
README.md
jmespath.rb
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
- Name: jmespath
- Login: jmespath
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/6053930?v=4
- Repositories: 17
- Last ynced at: 2025-10-30T00:34:28.267Z
- Profile URL: https://github.com/jmespath
GitHub Events
Total
- Pull request event: 4
- Fork event: 5
- Issues event: 1
- Watch event: 6
- Issue comment event: 2
- Pull request review event: 1
Last Year
- Fork event: 4
- Issues event: 1
- Watch event: 5
- Issue comment event: 1
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 | 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:
- burtcorp.com: 2
- amazon.com: 2
- timcraft.com: 1
- gitter.im: 1
- biaprotect.com: 1
- vasto.la: 1
- pocke.me: 1
- clear-code.com: 1
- threedogconsulting.com: 1
- jamesls.com: 1
- civ.zcu.cz: 1
- chrisroberts.org: 1
- ctl.io: 1
- freshworks.com: 1
- mdsol.com: 1
- iconara.net: 1
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
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
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 20
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
- absolute_time >= 0 development
- octokit >= 0 development
- rdiscount >= 0 development
- yard >= 0 development
- yard-sitemap ~> 1.0 development
- rake >= 0
- rspec ~> 3.0
- actions/checkout v2 composite
- ruby/setup-ruby v1 composite
Score: -Infinity

