{"id":23335883,"url":"https://github.com/taimoorzaeem/aeson-jsonpath","last_synced_at":"2025-10-28T17:30:53.176Z","repository":{"id":268553583,"uuid":"903723142","full_name":"taimoorzaeem/aeson-jsonpath","owner":"taimoorzaeem","description":"Run RFC 9535 compliant JSONPath queries on Data.Aeson","archived":false,"fork":false,"pushed_at":"2025-02-11T07:51:31.000Z","size":136,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T08:43:36.239Z","etag":null,"topics":["aeson","haskell","jsonpath","rfc"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/aeson-jsonpath","language":"Haskell","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/taimoorzaeem.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"taimoorzaeem"}},"created_at":"2024-12-15T11:54:44.000Z","updated_at":"2025-02-11T07:51:32.000Z","dependencies_parsed_at":"2024-12-17T13:37:54.748Z","dependency_job_id":"c54289fc-4eb8-4f03-bf22-9937a130c84a","html_url":"https://github.com/taimoorzaeem/aeson-jsonpath","commit_stats":null,"previous_names":["taimoorzaeem/aeson-jsonpath"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taimoorzaeem%2Faeson-jsonpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taimoorzaeem%2Faeson-jsonpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taimoorzaeem%2Faeson-jsonpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taimoorzaeem%2Faeson-jsonpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taimoorzaeem","download_url":"https://codeload.github.com/taimoorzaeem/aeson-jsonpath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238264176,"owners_count":19443368,"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":["aeson","haskell","jsonpath","rfc"],"created_at":"2024-12-21T02:10:48.413Z","updated_at":"2025-10-28T17:30:53.170Z","avatar_url":"https://github.com/taimoorzaeem.png","language":"Haskell","funding_links":["https://patreon.com/taimoorzaeem","https://www.patreon.com/taimoorzaeem"],"categories":[],"sub_categories":[],"readme":"# aeson-jsonpath\n\n[![Build](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/build.yml/badge.svg)](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/build.yml) [![hackage-docs](https://img.shields.io/badge/hackage-v0.3.0.2-blue)](https://hackage.haskell.org/package/aeson-jsonpath) [![Donate](https://img.shields.io/badge/Donate-Patreon-red)](https://www.patreon.com/taimoorzaeem) [![Compliance](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/compliance.yml/badge.svg)](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/compliance.yml)\n\nRun [RFC 9535](https://www.rfc-editor.org/rfc/rfc9535) compliant JSONPath queries on [Data.Aeson](https://hackage.haskell.org/package/aeson).\n\n## Roadmap\n\n- [x] Selectors\n  - [x] Name Selector\n  - [x] Index Selector\n  - [x] Slice Selector\n  - [x] Wildcard Selector\n  - [x] Filter Selector\n- [x] Segments\n  - [x] Child Segment\n  - [x] Descendant Segment\n- [x] Normalized Paths\n- [ ] Function Extensions\n\nI have decided **not** to implement Function Extensions yet. Please open an issue or discussion if you'd like to see them implemented.\n\n## Quick Start\n\n```haskell\n{-# LANGUAGE QuasiQuotes #-}\nimport Data.Aeson           (Value (..))\nimport Data.Aeson.QQ.Simple (aesonQQ)\nimport Data.Aeson.JSONPath  (query, queryLocated, jsonPath)\n\ntrack = [aesonQQ| { \"artist\": \"Duster\", \"title\": \"Earth Moon Transit\" } |]\n\nghci\u003e query \"$.artist\" track -- child member shorthand\nRight [String \"Duster\"]\n\nghci\u003e queryLocated \"$.*\" track -- child wildcard segment\nRight [\n  (\"$['artist']\", String \"Duster\"),\n  (\"$['title']\", String \"Earth Moon Transit\")\n]\n```\n\n## More Examples\n\n```haskell\n{-# LANGUAGE QuasiQuotes #-}\nimport Data.Aeson           (Value (..))\nimport Data.Aeson.QQ.Simple (aesonQQ)\nimport Data.Aeson.JSONPath  (query, queryLocated, jsonPath)\n\njson = [aesonQQ| {\n  \"shop\": {\n    \"movies\": [\n      {\n        \"title\": \"Mandy\",\n        \"director\": \"Panos Cosmatos\",\n        \"year\": 2018\n      },\n      {\n        \"title\": \"Laurence Anyways\",\n        \"director\": \"Xavier Dolan\",\n        \"year\": 2012\n      }\n    ]\n  }\n}|]\n```\n\n### Child Segment\n\n```haskell\nghci\u003e query \"$.shop.movies[0].title\" json\nRight [String \"Mandy\"]\n\nghci\u003e query \"$.shop.movies[0].*\" json\nRight [\n  String \"Mandy\",\n  String \"Panos Cosmatos\",\n  Number 2018.0\n]\n\nghci\u003e query \"$['shop']['new-movies']\" json\nRight []\n```\n\n### Descendant Segment\n\n```haskell\n-- get all values with key \"director\", recursively\nghci\u003e query \"$..director\" json\nRight [\n  String \"Panos Cosmatos\",\n  String \"Xavier Dolan\"\n]\n-- query along with locations\nghci\u003e queryLocated \"$..director\" json\nRight [\n  (\"$['shop']['movies'][0]['director']\",String \"Panos Cosmatos\"),\n  (\"$['shop']['movies'][1]['director']\",String \"Xavier Dolan\")\n]\n```\n\n### Slice Selector\n\n```haskell\nghci\u003e query \"$[2:5]\" [aesonQQ| [1,2,3,4,5,6] |]\nRight [\n  Number 3.0,\n  Number 4.0,\n  Number 5.0\n]\n```\n\n### Filter Selector\n\n```haskell\nghci\u003e query \"$.shop.movies[?@.year \u003c 2015]\" json\nRight [\n  Object (fromList [\n    (\"director\",String \"Xavier Dolan\"),\n    (\"title\",String \"Laurence Anyways\"),\n    (\"year\",Number 2012.0)\n  ])\n]\n\nghci\u003e queryLocated \"$.shop.movies[?@.director == 'Panos Cosmatos']\" json\nRight [\n  (\n    \"$['shop']['movies'][0]\",\n    Object (fromList [\n      (\"director\",String \"Panos Cosmatos\"),\n      (\"title\",String \"Mandy\"),\n      (\"year\",Number 2018.0)\n    ])\n  )\n]\n```\n\n### QuasiQuoter\n\nThe functions `queryQQ` and `queryLocatedQQ` can be used with the `jsonPath` quasi quoter.\n\n```haskell\nqueryQQ [jsonPath|$.shop.movies|] json -- compiles successfully\n\nqueryQQ [jsonPath|$.shop$$movies|] json -- compilation error, doesn't parse\n```\n\n## Testing\n\nIt is tested using 10000+ lines test suite given by [jsonpath-compliance-test-suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite) :rocket:.\n\n\u003e [!NOTE]\n\u003e All tests pass except tests related to **function extensions** which we have not implemented yet.\n\n## Development\n\nPlease report any bugs you encounter by opening an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaimoorzaeem%2Faeson-jsonpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaimoorzaeem%2Faeson-jsonpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaimoorzaeem%2Faeson-jsonpath/lists"}