{"id":32173427,"url":"https://github.com/konnexionsgmbh/jpparse","last_synced_at":"2025-10-21T18:54:30.656Z","repository":{"id":19432542,"uuid":"22676075","full_name":"KonnexionsGmbH/jpparse","owner":"KonnexionsGmbH","description":"JSON Path Parse","archived":false,"fork":false,"pushed_at":"2020-05-12T11:00:23.000Z","size":111,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-21T18:54:16.638Z","etag":null,"topics":["erlang","jsonpath"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KonnexionsGmbH.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":"2014-08-06T08:51:15.000Z","updated_at":"2021-05-21T17:49:16.000Z","dependencies_parsed_at":"2022-08-24T11:20:07.826Z","dependency_job_id":null,"html_url":"https://github.com/KonnexionsGmbH/jpparse","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/KonnexionsGmbH/jpparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonnexionsGmbH%2Fjpparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonnexionsGmbH%2Fjpparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonnexionsGmbH%2Fjpparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonnexionsGmbH%2Fjpparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KonnexionsGmbH","download_url":"https://codeload.github.com/KonnexionsGmbH/jpparse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonnexionsGmbH%2Fjpparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280317282,"owners_count":26309997,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["erlang","jsonpath"],"created_at":"2025-10-21T18:54:29.629Z","updated_at":"2025-10-21T18:54:30.651Z","avatar_url":"https://github.com/KonnexionsGmbH.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JPParse \n\n![build](https://github.com/KonnexionsGmbH/jpparse/workflows/Erlang%20CI/badge.svg)\n![Hex.pm](https://img.shields.io/hexpm/v/jpparse.svg)\n![Coveralls github](https://img.shields.io/coveralls/github/KonnexionsGmbH/jpparse.svg)\n![GitHub](https://img.shields.io/github/license/KonnexionsGmbH/jpparse.svg)\n![GitHub release](https://img.shields.io/github/release/KonnexionsGmbH/jpparse.svg)\n![GitHub Release Date](https://img.shields.io/github/release-date/KonnexionsGmbH/jpparse.svg)\n![GitHub commits since latest release](https://img.shields.io/github/commits-since/KonnexionsGmbH/jpparse/1.3.0.svg)\n\n## Introduction:\n\nJson Path Parser parses a Json path into an abstract syntax tree, ready to be interpreted for matching them to json data objects.\n\n### Still missing:\n\n## Glossary:\n### For the path expression:\n\n\u003cdl\u003e\n\u003cdt\u003eProperty\u003c/dt\u003e\n    \u003cdd\u003ekey/attribute of a json object\u003c/dd\u003e\n\u003cdt\u003eValue\u003c/dt\u003e\n   \u003cdd\u003eWhatever data is associated with a property in a json object\u003c/dd\u003e\n\u003cdt\u003e':'\u003c/dt\u003e\n    \u003cdd\u003eColumns are used to access properties of objects (if an object has multiple identical properties, only the last one will match).\u003c/dd\u003e\n\u003cdt\u003e'[ ]'\u003c/dt\u003e\n    \u003cdd\u003eSquare brackets signify you expect the data to be a list, and you wish to traverse it.\u003cbr\u003e\n    They can contain:\n\u003cul\u003e       \n \u003cli\u003eno value: meaning you wish to traverse the whole list.\u003c/li\u003e\n      \u003cli\u003e  a number: meaning you wish to only access the data on that index of the list\u003c/li\u003e\n       \u003cli\u003e a range (ex. 1-45): meaning you wish to traverse a sublist\u003c/li\u003e\n        \u003cli\u003emultiple numbers (ex 1,2,5): meaning you wish to access the data only on those index numbers\u003c/li\u003e\u003c/ul\u003e\u003c/dd\u003e\n\n\u003cdt\u003e'{ }'\u003c/dt\u003e\n    \u003cdd\u003eCurly braces signify you expect the data to be an object, and you wish to somehow traverse it\u003cbr\u003e\n    They can contain:\n       \u003cul\u003e\u003cli\u003e no value: meaning you wish to traverse every value of the whole object\u003c/li\u003e\n        \u003cli\u003ea property: meaning you wish to access the value of that property (same as using a column). Only the last corresponding property will match.\u003c/li\u003e\n       \u003cli\u003e multiple properties: meaning you wish to access the values of those properties\u003c/li\u003e\u003c/ul\u003e\u003c/dd\u003e\n\n\u003cdt\u003e'$keys$'\u003c/dt\u003e\n   \u003cdd\u003e Signifies you wish to work on (or return) the object keys as if they were a list (containing the object's keys). Is understood as being a property.\u003c/dd\u003e\n   \n\u003cdt\u003e'$values$'\u003c/dt\u003e\n   \u003cdd\u003e Signifies you wish to work on (or return) the object values as if they were a list (containing the object's values). Is understood as being a property.\u003c/dd\u003e\n   \n\u003cdt\u003e'$firstChild$'\u003c/dt\u003e\n    \u003cdd\u003eSignifies you wish to work on the first value of the object, whatever the key. Is understood as being a property.\u003c/dd\u003e\n\u003c/dl\u003e\n\n#### \"single value / list of values as result\" operator correspondence table\nFrom the moment a path expression contains an operator who returns a list, result will be a list, even if only a single object matches.\n\ninput | output\n--- | ---\n`a:b` when `b` is list | List \n`a:b` when `b` is object | Single (object) \n`a:b` when `b` is neither list or object | Single (value) \n`a[]` | List \n`a[1]` | List \n`a[1,2]` | List \n`b{}` | List \n`b{prop}` | List \n`b{$keys$}` | Single (object)\n\n### For the parsed form expression:\n\u003cdl\u003e\n\u003cdt\u003e'_'\u003c/dt\u003e\n\u003cdd\u003e    When used as second parameter in '{ }' or '[ ]' functions, signifies 'match all'\n    When used as first parameter, signifies 'work on anonymous root data object' (used when the path expression starts with brackets or curly braces, or to access the root object).\u003c/dd\u003e\n\n\u003cdt\u003e'{}'\u003c/dt\u003e\n    \u003cdd\u003eBinary function. First parameter is the object to work on, second the attribute(s).\n    It's the default operator: `{':', [a]}` is equal in meaning to `{':', [{'{}', '_', a}]}`, and should internally be treated as such.\u003c/dd\u003e\n\n\u003cdt\u003e'[]'\u003c/dt\u003e\n    \u003cdd\u003eBinary function: First parameter is the list to work on, second the index(es).\u003c/dd\u003e\n\n\u003cdt\u003e'-'\u003c/dt\u003e\n    \u003cdd\u003eBinary function: First parameter is the position to start from, second the position to stop at.\u003c/dd\u003e\n\n\u003cdt\u003e':'\u003c/dt\u003e\n    \u003cdd\u003eUnary function: Parameter list contains the path elements to traverse.\u003c/dd\u003e\n\n\u003cdt\u003e'$anything$\u003c/dt\u003e\n    \u003cdd\u003eNullary function: translates to whatever the inclosed name may mean (currently supported: `firstChild`, `keys`, `values`)\u003c/dd\u003e\n       \n\n## jpparse grammar/syntax examples:\n\npath expression | parsed form\n--- | ---\n`\u003c\u003c\"a{}[]\"\u003e\u003e` | `{'[]',{'{}',\u003c\u003c\"a\"\u003e\u003e,[][]}`\n`\u003c\u003c\"a[1,2,3]\"\u003e\u003e` | `{'[]',\u003c\u003c\"a\"\u003e\u003e,[1,2,3]}`\n`\u003c\u003c\"a{x,y,z}\"\u003e\u003e` | `{'{}',\u003c\u003c\"a\"\u003e\u003e,[\u003c\u003c\"x\"\u003e\u003e,\u003c\u003c\"y\"\u003e\u003e,\u003c\u003c\"z\"\u003e\u003e]}`\n`\u003c\u003c\"a:b[]:c\"\u003e\u003e` | `{':',\u003c\u003c\"c\"\u003e\u003e,{'[]',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e[]}}`\n`\u003c\u003c\"a:b[1,2,3]\"\u003e\u003e` | `{'[]',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e[1,2,3]}`\n`\u003c\u003c\"a:b{x,y,z}\"\u003e\u003e` | `{'{}',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e[\u003c\u003c\"x\"\u003e\u003e,\u003c\u003c\"y\"\u003e\u003e,\u003c\u003c\"z\"\u003e\u003e]}`\n`\u003c\u003c\"a[]{}:b{}[]\"\u003e\u003e` | `{'[]',{'{}',{':',\u003c\u003c\"b\"\u003e\u003e,{'{}',{'[]',\u003c\u003c\"a\"\u003e\u003e,[][]}[][]}`\n`\u003c\u003c\"a{$tok$}\"\u003e\u003e` | `{'{}',\u003c\u003c\"a\"\u003e\u003e,[{'$',\u003c\u003c\"tok\"\u003e\u003e}]}`\n`\u003c\u003c\"a:b{$tok$}[1,2]\"\u003e\u003e` | `{'[]',{'{}',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e[{'$',\u003c\u003c\"tok\"\u003e\u003e}][1,2]}`\n`\u003c\u003c\"a{f(x)}[f(y)]\"\u003e\u003e` | `{'[]',{'{}',\u003c\u003c\"a\"\u003e\u003e,[{'fun',\u003c\u003c\"f\"\u003e\u003e,[\u003c\u003c\"x\"\u003e\u003e]}][{'fun',\u003c\u003c\"f\"\u003e\u003e,[\u003c\u003c\"y\"\u003e\u003e]}]}`\n`\u003c\u003c\"a:b[f()]:c\"\u003e\u003e` | `{':',\u003c\u003c\"c\"\u003e\u003e,{'[]',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e},[{'fun',\u003c\u003c\"f\"\u003e\u003e,[]}]}}`\n`\u003c\u003c\"a:b{f()}:c\"\u003e\u003e` | `{':',\u003c\u003c\"c\"\u003e\u003e,{'{}',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e},[{'fun',\u003c\u003c\"f\"\u003e\u003e,[]}]}}`\n`\u003c\u003c\"a:f(y(p,q),x):c\"\u003e\u003e` | `{':',\u003c\u003c\"c\"\u003e\u003e,{':',{'fun',\u003c\u003c\"f\"\u003e\u003e,[{'fun',\u003c\u003c\"y\"\u003e\u003e,[\u003c\u003c\"p\"\u003e\u003e,\u003c\u003c\"q\"\u003e\u003e]\u003c\u003c\"x\"\u003e\u003e]},\u003c\u003c\"a\"\u003e\u003e}}`\n`\u003c\u003c\"a:b[]{f(x:y)}:c\"\u003e\u003e` | `{':',\u003c\u003c\"c\"\u003e\u003e,{'{}',{'[]',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e},[]},[{'fun',\u003c\u003c\"f\"\u003e\u003e,[{':',\u003c\u003c\"y\"\u003e\u003e,\u003c\u003c\"x\"\u003e\u003e}]}]}}`\n\n[more examples](https://github.com/KonnexionsGmbH/jpparse/blob/master/test/test.txt)\n\n### Example Usage\n\n```erlang\n1\u003e jpparse:parsetree_with_tokens(\"a:b\").\n{ok,{{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e},\n     [{'STRING',1,\"a\"},{':',1},{'STRING',1,\"b\"}]}}\n2\u003e jpparse:parsetree(\"a:b{1-2\"). \n{parse_error,{1,\"syntax error before: '-'\",\n              [{'STRING',1,\"a\"},\n               {':',1},\n               {'STRING',1,\"b\"},\n               {'{',1},\n               {'STRING',1,\"1\"},\n               {'-',1},\n               {'STRING',1,\"2\"}]}}\n3\u003e jpparse:parsetree(\"a:b[1-2\").\n{parse_error,{1,\"syntax error before: '-'\",\n              [{'STRING',1,\"a\"},\n               {':',1},\n               {'STRING',1,\"b\"},\n               {'[',1},\n               {'STRING',1,\"1\"},\n               {'-',1},\n               {'STRING',1,\"2\"}]}}\n4\u003e jpparse:parsetree_with_tokens(\"a:b[1,2]\").\n{ok,{{'[]',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e},[1,2]},\n     [{'STRING',1,\"a\"},\n      {':',1},\n      {'STRING',1,\"b\"},\n      {'[',1},\n      {'STRING',1,\"1\"},\n      {',',1},\n      {'STRING',1,\"2\"},\n      {']',1}]}}\n5\u003e jpparse:parsetree_with_tokens(\"a:b{x,y}\").\n{ok,{{'{}',{':',\u003c\u003c\"b\"\u003e\u003e,\u003c\u003c\"a\"\u003e\u003e},[\u003c\u003c\"x\"\u003e\u003e,\u003c\u003c\"y\"\u003e\u003e]},\n     [{'STRING',1,\"a\"},\n      {':',1},\n      {'STRING',1,\"b\"},\n      {'{',1},\n      {'STRING',1,\"x\"},\n      {',',1},\n      {'STRING',1,\"y\"},\n      {'}',1}]}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonnexionsgmbh%2Fjpparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonnexionsgmbh%2Fjpparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonnexionsgmbh%2Fjpparse/lists"}