{"id":24915719,"url":"https://github.com/fd/json_select","last_synced_at":"2025-04-13T09:37:38.054Z","repository":{"id":1523825,"uuid":"1788277","full_name":"fd/json_select","owner":"fd","description":"CSS-like selectors for JSON (Ruby implementation).","archived":false,"fork":false,"pushed_at":"2013-03-12T11:32:22.000Z","size":144,"stargazers_count":113,"open_issues_count":3,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T01:10:01.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jsonselect.org","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/fd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-23T14:22:55.000Z","updated_at":"2024-02-23T19:56:12.000Z","dependencies_parsed_at":"2022-08-16T13:35:19.640Z","dependency_job_id":null,"html_url":"https://github.com/fd/json_select","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fd%2Fjson_select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fd%2Fjson_select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fd%2Fjson_select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fd%2Fjson_select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fd","download_url":"https://codeload.github.com/fd/json_select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248691657,"owners_count":21146411,"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":[],"created_at":"2025-02-02T07:19:07.666Z","updated_at":"2025-04-13T09:37:38.015Z","avatar_url":"https://github.com/fd.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONSelect [![Build Status](http://travis-ci.org/fd/json_select.png)](http://travis-ci.org/fd/json_select)\n\n**CSS-like selectors for JSON.**\n\n[More info about the JSON:select format](http://jsonselect.org/)\n\n## Installation\n\nFrom your terminal:\n\n```bash\ngem install json_select\n```\n\nIn your `Gemfile`:\n\n```ruby\ngem 'json_select'\n```\n\n## Usage\n\n```ruby\nrequire 'json_select'\n\njson = { # This would normally be loaded with something like yajl-ruby\n  \"name\" =\u003e {\n    \"first\" =\u003e \"Lloyd\",\n    \"last\" =\u003e \"Hilaiel\"\n  },\n  \"favoriteColor\" =\u003e \"yellow\",\n  \"languagesSpoken\" =\u003e [\n    {\n      \"language\" =\u003e \"Bulgarian\",\n      \"level\" =\u003e \"advanced\"\n    },\n    {\n      \"language\" =\u003e \"English\",\n      \"level\" =\u003e \"native\"\n    },\n    {\n      \"language\" =\u003e \"Spanish\",\n      \"level\" =\u003e \"beginner\"\n    }\n  ],\n  \"seatingPreference\" =\u003e [ \"window\", \"aisle\" ],\n  \"drinkPreference\" =\u003e [ \"beer\", \"whiskey\", \"wine\" ],\n  \"weight\" =\u003e 172\n}\n\nJSONSelect('string:first-child').test(json)    # =\u003e true\nJSONSelect('string:first-child').match(json)   # =\u003e \"window\"\nJSONSelect('string:first-child').matches(json) # =\u003e [\"window\", \"beer\"]\n```\n\n## Language support\n\n✓ — **Level 1** — `*`\u003cbr\u003e\nAny node\n\n✓ — **Level 1** — `T`\u003cbr\u003e\nA node of type `T`, where `T` is one `string`, `number`, `object`, `array`, `boolean`, or `null`\n\n✓ — **Level 1** — `T.key`\u003cbr\u003e\nA node of type `T` which is the child of an object and is the value its parents key property\n\n✓ — **Level 1** — `T.\"complex key\"`\u003cbr\u003e\nSame as previous, but with property name specified as a JSON string\n\n✓ — **Level 1** — `T:root`\u003cbr\u003e\nA node of type `T` which is the root of the JSON document\n\n✓ — **Level 1** — `T:nth-child(n)`\u003cbr\u003e\nA node of type `T` which is the nth child of an array parent\n\n✓ — **Level 2** — `T:nth-last-child(n)`\u003cbr\u003e\nA node of type `T` which is the nth child of an array parent counting from the end\n\n✓ — **Level 1** — `T:first-child`\u003cbr\u003e\nA node of type `T` which is the first child of an array parent (equivalent to `T:nth-child(1)`)\n\n✓ — **Level 2** — `T:last-child`\u003cbr\u003e\nA node of type `T` which is the last child of an array parent (equivalent to `T:nth-last-child(1)`)\n\n✓ — **Level 2** — `T:only-child`\u003cbr\u003e\nA node of type `T` which is the only child of an array parent\n\n✓ — **Level 2** — `T:empty`\u003cbr\u003e\nA node of type `T` which is an array or object with no child\n\n✓ — **Level 1** — `T U`\u003cbr\u003e\nA node of type `U` with an ancestor of type `T`\n\n✓ — **Level 1** — `T \u003e U`\u003cbr\u003e\nA node of type `U` with a parent of type `T`\n\n✗ — **Level 2** — `T ~ U`\u003cbr\u003e\nA node of type `U` with a sibling of type `T`\n\n✓ — **Level 1** — `S1, S2`\u003cbr\u003e\nAny node which matches either selector `S1` or `S2`\n\n✗ — **Level 3** — `T:has(S)`\u003cbr\u003e\nA node of type `T` which has a child node satisfying the selector `S`\n\n\n## Note on Patches/Pull Requests\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don't break it in a future version\n  unintentionally.\n* Commit, do not mess with `Rakefile` or version. (if you want to have your\n  own version, that is fine but bump version in a commit by itself I can\n  ignore when I pull)\n* Send me a pull request. Bonus points for topic branches.\n\n## Copyright\n\nCopyright (c) 2011 Simon Menke. See LICENSE for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffd%2Fjson_select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffd%2Fjson_select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffd%2Fjson_select/lists"}