{"id":26151738,"url":"https://github.com/uvlad7/ruby-jsoncons","last_synced_at":"2026-05-20T10:02:15.439Z","repository":{"id":65177614,"uuid":"585719555","full_name":"uvlad7/ruby-jsoncons","owner":"uvlad7","description":"Ruby gem that wraps jsoncons library","archived":false,"fork":false,"pushed_at":"2023-10-07T23:33:45.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T13:22:11.298Z","etag":null,"topics":["gem","json","json-parse","json-parser","json-parsing","json-path","jsonparser","jsonpath","ruby","ruby-gem","rubygem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/jsoncons","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uvlad7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-05T22:30:29.000Z","updated_at":"2024-12-16T08:36:45.000Z","dependencies_parsed_at":"2023-02-12T21:45:30.625Z","dependency_job_id":null,"html_url":"https://github.com/uvlad7/ruby-jsoncons","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"741d2c547e31479db8be2d191177c0f66c4924f0"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uvlad7%2Fruby-jsoncons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uvlad7%2Fruby-jsoncons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uvlad7%2Fruby-jsoncons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uvlad7%2Fruby-jsoncons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uvlad7","download_url":"https://codeload.github.com/uvlad7/ruby-jsoncons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242987800,"owners_count":20217534,"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":["gem","json","json-parse","json-parser","json-parsing","json-path","jsonparser","jsonpath","ruby","ruby-gem","rubygem"],"created_at":"2025-03-11T06:39:22.411Z","updated_at":"2026-05-20T10:02:10.398Z","avatar_url":"https://github.com/uvlad7.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/jsoncons.svg)](https://badge.fury.io/rb/jsoncons)\n\n# Jsoncons\n\nThis gem is a thin Ruby wrapper over a C++ [jsoncons](https://github.com/danielaparker/jsoncons) library.\nBut while the original library is designed as a multi-purpose tool for processing json and json-like data in C++, in the Ruby world, most of these features are not needed.\nWe already have libraries like Json, CSV, Bson and JMESPath, designed for Ruby and following its style.\nBut [JsonPath](https://goessner.net/articles/JsonPath/) support is [missing](https://cburgmer.github.io/json-path-comparison/).\nThe [existing library](https://github.com/joshbuddy/jsonpath) is really slow and contains a lot of bugs.\nSo, the purpose of this gem is to access the power of a well-crafted already existing solution at the cost of the inconvenience of C++ style in Ruby.\nWrappers for other features, as well as Ruby-style data converters, will probably never be created.\nBut if you believe that these features might be useful, feel free to open an issue or start a discussion. Pull requests are welcome, too.\n\nThe [latest version](https://github.com/danielaparker/jsoncons/tree/73c85182dc56d4441cdcd97255b23aa6f15b9121) of the library was used to build the [current version](https://github.com/uvlad7/ruby-jsoncons/releases/tag/v0.1.0) of the gem.\nNew versions of the gem will target the latest releases of the library, but you cat still try to build it with an older version or your custom version.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'jsoncons'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install jsoncons\n\nOr, if you downloaded the sources:\n\n    $ rake install\n\nIf you want to install the gem with a different version of the `jsoncons` library, you can use the following commands:\n\n    $ gem install jsoncons -- --with-jsoncons-dir=/path/to/jsoncons\n\nor\n\n    $ gem install jsoncons -- --with-jsoncons-include=/path/to/jsoncons/include\n\nor when building from source\n\n    $ CONFIGURE_ARGS='--with-jsoncons-dir=/path/to/jsoncons' rake install\n\n## Usage\n\n[Tests](https://github.com/uvlad7/ruby-jsoncons/blob/master/test/jsoncons_test.rb) are the best example\n\nParse data from [this example](https://github.com/danielaparker/jsoncons/blob/master/doc/ref/jsonpath/json_query.md)\n\n```ruby\nrequire 'jsoncons'\ndata = Jsoncons::Json.parse(File.read(\"store.json\"))\n#  =\u003e {\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":\"Sayings of the Century\",\"price\":8.95},{\"category\":\"fiction\",\"author\":\"Evelyn Waugh\",\"title\":\"Sword of Honour\",\"price\":12.99},{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99},{\"category\":\"fiction\",\"author\":\"J. R. R. Tolkien\",\"title\":\"The Lord of the Rings\",\"isbn\":\"0-395-19395-8\",\"price\":22.99}]}} \n\n# The authors of books that are cheaper than $10\ndata.query(\"$.store.book[?(@.price \u003c 10)].author\")\n# =\u003e [\"Nigel Rees\",\"Herman Melville\"]\n\n# The number of books\ndata.query(\"length($..book)\")\n# =\u003e [1] \n\n# The third book\ndata.query(\"$..book[2]\")\n# =\u003e [{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99}] \n\n# All books whose author's name starts with Evelyn (C++ regex)\ndata.query(\"$.store.book[?(@.author =~ /Evelyn.*?/)]\")\n# =\u003e [{\"category\":\"fiction\",\"author\":\"Evelyn Waugh\",\"title\":\"Sword of Honour\",\"price\":12.99}]\n\n# The titles of all books that have isbn number\ndata.query(\"$..book[?(@.isbn)].title\")\n# =\u003e [\"Moby Dick\",\"The Lord of the Rings\"]\n\n# And so on\n```\n\nPlease note that this is the very first version of the gem and its API is likely to change in the future.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/uvlad7/jsoncons.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuvlad7%2Fruby-jsoncons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuvlad7%2Fruby-jsoncons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuvlad7%2Fruby-jsoncons/lists"}