{"id":15008669,"url":"https://github.com/f3ath/jessie","last_synced_at":"2025-07-20T20:05:57.506Z","repository":{"id":37892341,"uuid":"282114014","full_name":"f3ath/jessie","owner":"f3ath","description":"RFC 9535 - JSONPath: Query Expressions for JSON implementation in Dart","archived":false,"fork":false,"pushed_at":"2025-07-06T19:00:47.000Z","size":261,"stargazers_count":38,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T19:44:41.664Z","etag":null,"topics":["dart","hacktoberfest","json","json-path","jsonpath","stupidity"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/json_path","language":"Dart","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/f3ath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2020-07-24T03:32:30.000Z","updated_at":"2025-07-06T18:58:33.000Z","dependencies_parsed_at":"2023-11-14T01:35:50.359Z","dependency_job_id":"ecfdf1fc-2803-4971-9fca-e40410f1007f","html_url":"https://github.com/f3ath/jessie","commit_stats":{"total_commits":113,"total_committers":4,"mean_commits":28.25,"dds":0.3008849557522124,"last_synced_commit":"beff4fefe64570fda6934aa6cbbff28e17ba9532"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/f3ath/jessie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fjessie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fjessie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fjessie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fjessie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f3ath","download_url":"https://codeload.github.com/f3ath/jessie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3ath%2Fjessie/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266189677,"owners_count":23890065,"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":["dart","hacktoberfest","json","json-path","jsonpath","stupidity"],"created_at":"2024-09-24T19:19:57.845Z","updated_at":"2025-07-20T20:05:57.501Z","avatar_url":"https://github.com/f3ath.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RFC 9535 - [JSONPath]: Query Expressions for JSON in Dart\n[![Pub Package](https://img.shields.io/pub/v/json_path.svg)](https://pub.dev/packages/json_path)\n[![GitHub Issues](https://img.shields.io/github/issues/f3ath/jessie.svg)](https://github.com/f3ath/jessie/issues)\n[![GitHub Forks](https://img.shields.io/github/forks/f3ath/jessie.svg)](https://github.com/f3ath/jessie/network)\n[![GitHub Stars](https://img.shields.io/github/stars/f3ath/jessie.svg)](https://github.com/f3ath/jessie/stargazers)\n[![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/f3ath/jessie/master/LICENSE)\n\nJSONPath defines a string syntax for selecting and extracting JSON (RFC 8259) values from within a given JSON value.\n\nThis library is a Dart implementation of the RFC 9535 [JsonPath] specification. It is also expected to pass the latest version\nof the [Compliance Test Suite]. If you find a missing or incorrectly implemented feature, please open an issue.\n\nFor installation instructions and a detailed API documentation, see the [pub.dev page](https://pub.dev/packages/json_path).\n\n### Usage example:\n```dart\nimport 'dart:convert';\n\nimport 'package:json_path/json_path.dart';\n\nvoid main() {\n  final json = jsonDecode('''\n{\n  \"store\": {\n    \"book\": [\n      {\n        \"category\": \"reference\",\n        \"author\": \"Nigel Rees\",\n        \"title\": \"Sayings of the Century\",\n        \"price\": 8.95\n      },\n      {\n        \"category\": \"fiction\",\n        \"author\": \"Evelyn Waugh\",\n        \"title\": \"Sword of Honour\",\n        \"price\": 12.99\n      },\n      {\n        \"category\": \"fiction\",\n        \"author\": \"Herman Melville\",\n        \"title\": \"Moby Dick\",\n        \"isbn\": \"0-553-21311-3\",\n        \"price\": 8.99\n      },\n      {\n        \"category\": \"fiction\",\n        \"author\": \"J. R. R. Tolkien\",\n        \"title\": \"The Lord of the Rings\",\n        \"isbn\": \"0-395-19395-8\",\n        \"price\": 22.99\n      }\n    ],\n    \"bicycle\": {\n      \"color\": \"red\",\n      \"price\": 19.95\n    }\n  }\n}  \n  ''');\n\n  final prices = JsonPath(r'$..price');\n\n  print('All prices in the store:');\n\n  /// The following code will print:\n  ///\n  /// $['store']['book'][0]['price']:\t8.95\n  /// $['store']['book'][1]['price']:\t12.99\n  /// $['store']['book'][2]['price']:\t8.99\n  /// $['store']['book'][3]['price']:\t22.99\n  /// $['store']['bicycle']['price']:\t19.95\n  prices\n      .read(json)\n      .map((match) =\u003e '${match.path}:\\t${match.value}')\n      .forEach(print);\n}\n```\n\n\n## Data manipulation\nEach `JsonPathMatch` produced by the `.read()` method contains the `.pointer` property which is a valid [JSON Pointer]\nand can be used to alter the referenced value. If you only need to manipulate JSON data, \ncheck out my [JSON Pointer implementation].\n\n## User-defined functions\nThe JSONPath parser may be extended with user-defined functions. The user-defined functions\ntake precedence over the built-in ones specified by the standard. Currently, only\nfunctions of 1 and 2 arguments are supported. \n\nTo create your own function:\n1. Import `package:json_path/fun_sdk.dart`.\n2. Create a class implementing either `Fun1` (1 argument) or `Fun2` (2 arguments).\n\nTo use it:\n1. Create a new JsonPathParser with your function: `final parser = JsonPathParser(functions: [MyFunction()]);`\n2. Parse the expression: `final jsonPath = parser.parse(r'$[?my_function(@)]');`\n\nFor more details see the included example.\n\nThis package comes with a few non-standard functions which you might find useful.\n- `count(\u003cNodeList\u003e)` - returns the number of nodes selected by the argument\n- `index(\u003cSingularNodeList\u003e)` - returns the index under which the array element is referenced by the parent array\n- `key(\u003cSingularNodeList\u003e)` - returns the key under which the object element is referenced by the parent object\n- `is_array(\u003cMaybe\u003e)` - returns true if the value is an array\n- `is_boolean(\u003cMaybe\u003e)` - returns true if the value is a boolean\n- `is_number(\u003cMaybe\u003e)` - returns true if the value is a number\n- `is_object(\u003cMaybe\u003e)` - returns true if the value is an object\n- `is_string(\u003cMaybe\u003e)` - returns true if the value is a string\n- `reverse(\u003cMaybe\u003e)` - returns the reversed string\n- `siblings(\u003cNodeList\u003e)` - returns the siblings for the nodes\n- `xor(\u003cbool\u003e, \u003cbool\u003e)` - returns the XOR of two booleans arguments\n\nTo use them, import `package:json_path/fun_extra.dart` and pass the functions to the `JsonPath()` constructor:\n\n```dart\nfinal jsonPath = JsonPathParser(functions: [\n  const Key(),\n  const Reverse(),\n]).parse(r'$[?key(@) == reverse(key(@))]');\n```\n## References\n- [Standard development](https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base)\n- [Feature comparison matrix](https://cburgmer.github.io/json-path-comparison/)\n\n[Compliance Test Suite]: https://github.com/jsonpath-standard/jsonpath-compliance-test-suite\n[JSONPath]: https://datatracker.ietf.org/doc/rfc9535/\n[JSON Pointer]: https://datatracker.ietf.org/doc/html/rfc6901\n[JSON Pointer implementation]: https://pub.dev/packages/rfc_6901\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3ath%2Fjessie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff3ath%2Fjessie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3ath%2Fjessie/lists"}