{"id":25060057,"url":"https://github.com/stla/jsonaccess","last_synced_at":"2026-05-01T13:33:17.971Z","repository":{"id":73101555,"uuid":"83909674","full_name":"stla/jsonAccess","owner":"stla","description":"Access directly to values and array elements in a JSON string.","archived":false,"fork":false,"pushed_at":"2017-03-14T16:17:35.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T11:15:26.297Z","etag":null,"topics":["json","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stla.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-04T17:01:23.000Z","updated_at":"2023-07-30T11:43:31.000Z","dependencies_parsed_at":"2023-03-18T13:41:54.821Z","dependency_job_id":null,"html_url":"https://github.com/stla/jsonAccess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stla/jsonAccess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FjsonAccess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FjsonAccess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FjsonAccess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FjsonAccess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stla","download_url":"https://codeload.github.com/stla/jsonAccess/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FjsonAccess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32499683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["json","r"],"created_at":"2025-02-06T15:56:34.825Z","updated_at":"2026-05-01T13:33:17.944Z","avatar_url":"https://github.com/stla.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The jsonAccess package\n\n\n\n\n```r\nlibrary(jsonAccess)\n```\n\nAssume you have the following JSON string:\n\n\n```r\n\u003e json \u003c- \"{\\\"a\\\": {\\\"b\\\": 8, \\\"c\\\": [2, [99, \\\"x\\\"]]}, \\\"b\\\": [10.14, 11.618]}\"\n```\n\n- Prettify:\n\n\n```r\n\u003e jsonPretty(json) %\u003e% cat\n## {\n##   \"a\": {\n##     \"b\": 8,\n##     \"c\": [\n##       2,\n##       [\n##         99,\n##         \"x\"\n##       ]\n##     ]\n##   },\n##   \"b\": [\n##     10.14,\n##     11.618\n##   ]\n## }\n```\n\n\n- Access to the value of the key `\"a\"`:\n\n\n\n```r\n\u003e jsonAccess(json, \"a\")\n## [1] \"{\\\"b\\\":8,\\\"c\\\":[2,[99,\\\"x\\\"]]}\"\n```\n\n\n- Try to access to a key which is not there:\n\n\n```r\n\u003e jsonAccess(json, \"z\")\n## [1] \"null\"\n```\n\n- Access to the value of the key `\"b\"` in the value of the key `\"a\"`:\n\n\n```r\n\u003e jsonAccess(json, c(\"a\",\"b\"))\n## [1] \"8\"\n```\n\n- Acces to the array in key `\"c\"`:\n\n\n\n```r\n\u003e ( Array \u003c- jsonAccess(json, c(\"a\",\"c\")) )\n## [1] \"[2,[99,\\\"x\\\"]]\"\n```\n\n- Get its 1-th element:\n\n\n```r\n\u003e jsonElemAt(Array, 1)\n## [1] \"[99,\\\"x\\\"]\"\n```\n\n- Get an element only if it is a number:\n\n\n```r\n\u003e jsonElemAt_ifNumber(Array, 0)\n## [1] \"2\"\n\u003e jsonElemAt_ifNumber(Array, 1)\n## [1] \"null\"\n```\n\n- Chain: \n\n\n```r\n\u003e jsonAccess(json, c(\"a\",\"c\")) %\u003e% jsonElemAt(1) %\u003e% jsonElemAt(1)\n## [1] \"\\\"x\\\"\"\n```\n\n- Get the members as an array of pairs:\n\n\n```r\n\u003e jsonMembers(json) %\u003e% jsonPretty %\u003e% cat\n## [\n##   [\n##     \"a\",\n##     {\n##       \"b\": 8,\n##       \"c\": [\n##         2,\n##         [\n##           99,\n##           \"x\"\n##         ]\n##       ]\n##     }\n##   ],\n##   [\n##     \"b\",\n##     [\n##       10.14,\n##       11.618\n##     ]\n##   ]\n## ]\n```\n\n___ \n\nThis package includes DLLs generated by the \nHaskell library [json-access](https://github.com/stla/json-access).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstla%2Fjsonaccess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstla%2Fjsonaccess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstla%2Fjsonaccess/lists"}