{"id":37910528,"url":"https://github.com/akshaybharambe14/ijson","last_synced_at":"2026-01-16T17:19:01.318Z","repository":{"id":57534588,"uuid":"281453739","full_name":"akshaybharambe14/ijson","owner":"akshaybharambe14","description":"Go package to quickly query and manipulate interface data.","archived":false,"fork":false,"pushed_at":"2021-04-25T05:40:02.000Z","size":111,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T05:02:10.725Z","etag":null,"topics":["go","golang","ijson","json","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","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/akshaybharambe14.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":"2020-07-21T16:49:53.000Z","updated_at":"2023-08-23T11:45:00.000Z","dependencies_parsed_at":"2022-09-26T18:21:39.745Z","dependency_job_id":null,"html_url":"https://github.com/akshaybharambe14/ijson","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/akshaybharambe14/ijson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshaybharambe14%2Fijson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshaybharambe14%2Fijson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshaybharambe14%2Fijson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshaybharambe14%2Fijson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshaybharambe14","download_url":"https://codeload.github.com/akshaybharambe14/ijson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshaybharambe14%2Fijson/sbom","scorecard":{"id":176755,"data":{"date":"2025-08-11","repo":{"name":"github.com/akshaybharambe14/ijson","commit":"0d1d32617332320b6ad1558774f98fd125f31015"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/akshaybharambe14/ijson/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/akshaybharambe14/ijson/test.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T17:49:48.148Z","repository_id":57534588,"created_at":"2025-08-16T17:49:48.148Z","updated_at":"2025-08-16T17:49:48.148Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","golang","ijson","json","parser"],"created_at":"2026-01-16T17:19:01.256Z","updated_at":"2026-01-16T17:19:01.304Z","avatar_url":"https://github.com/akshaybharambe14.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg\n        src=\"./assets/logo.png\"\n        width=\"196\" height=\"239\" border=\"0\" alt=\"IJSON\"\n    \u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/akshaybharambe14/ijson\"\u003e\n        \u003cimg src=\"https://pkg.go.dev/badge/github.com/akshaybharambe14/ijson\" alt=\"PkgGoDev\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/akshaybharambe14/ijson/actions?query=workflow%3A%22Build+and+test%22\"\u003e\n        \u003cimg src=\"https://github.com/akshaybharambe14/ijson/workflows/Build%20and%20test/badge.svg\" alt=\"Build and Test Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/akshaybharambe14/ijson\"\u003e\n        \u003cimg src=\"https://goreportcard.com/badge/github.com/akshaybharambe14/ijson\" alt=\"Go report\"\u003e\n    \u003c/a\u003e\n    \u003cbr\u003e\n    Query \u003cb\u003e\u003ci\u003eI\u003c/i\u003e\u003c/b\u003enterface \u003cb\u003e\u003ci\u003eJSON\u003c/i\u003e\u003c/b\u003e and set or delete values easily\n\u003c/p\n\n\u003c!--\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/akshaybharambe14/ijson)](https://pkg.go.dev/github.com/akshaybharambe14/ijson)\n[![Build and Test Status](https://github.com/akshaybharambe14/ijson/workflows/Build%20and%20test/badge.svg)](https://github.com/akshaybharambe14/ijson/actions?query=workflow%3A%22Build+and+test%22)\n[![PkgGoDev](https://goreportcard.com/badge/github.com/akshaybharambe14/ijson)](https://goreportcard.com/report/github.com/akshaybharambe14/ijson)\n\n--\u003e\n\n**IJSON** is a small but effective utility to deal with **dynamic** or **unknown JSON structures** in [Go](https://golang.org). It's a helpful wrapper for navigating hierarchies of `map[string]interface{}` OR `[]interface{}`. It is the best solution for one time data access and manipulation.\n\nOther libraries parse the whole json structure in their own format and again to interface if required, not suitable if you have `interface{}` as input and want the output in same format.\n\n\u003e **Note** - This is not a json parser. It just plays with raw interface data.\n\n## Features\n\n- Very fast in accessing and manipulating top level values.\n- Avoids parsing whole JSON structure to intermediate format. Saves allocations.\n- Easy API to perform **query**, **set** or **delete** operations on raw interface data.\n- **One line syntax** to chain multiple operations together.\n\n## Known limitations\n\n- Not suitable if you want to perform multiple operations on same data.\n\n## Getting started\n\n### Installation\n\n```sh\ngo get -u github.com/akshaybharambe14/ijson\n```\n\n### Usage and Example\n\nThis package provides two types of functions. The functions suffixed with `\u003caction\u003eP` accept a path separated by `\".\"`.\n\nEx. \"#0.friends.#~name\"\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/akshaybharambe14/ijson\"\n)\n\nvar dataBytes = []byte(`\n[\n\t{\n\t  \"index\": 0,\n\t  \"friends\": [\n\t\t{\n\t\t  \"id\": 0,\n\t\t  \"name\": \"Justine Bird\"\n\t\t},\n\t\t{\n\t\t  \"id\": 0,\n\t\t  \"name\": \"Justine Bird\"\n\t\t},\n\t\t{\n\t\t  \"id\": 1,\n\t\t  \"name\": \"Marianne Rutledge\"\n\t\t}\n\t  ]\n\t}\n]\n`)\n\nfunc main() {\n\tr := ijson.ParseByes(dataBytes).\n\t\tGetP(\"#0.friends.#~name\"). // list the friend names for 0th record -\n\t\t// []interface {}{\"Justine Bird\", \"Justine Bird\", \"Marianne Rutledge\"}\n\n\t\tDel(\"#0\"). // delete 0th record\n\t\t// []interface {}{\"Marianne Rutledge\", \"Justine Bird\"}\n\n\t\tSet(\"tom\", \"#\") // append \"tom\" in the list\n\t\t// []interface {}{\"Marianne Rutledge\", \"Justine Bird\", \"tom\"}\n\n\tfmt.Printf(\"%#v\\n\", r.Value())\n\n\t// returns error if the data type differs than the type expected by query\n\tfmt.Println(r.Set(1, \"name\").Error())\n}\n\n```\n\n### Path syntax\n\nIJSON follows a specific path syntax to access the data. The implementation sticks to the analogy that, user knows the path. So if caller wants to access an index, the underlying data must be an array otherwise, an error will be returned.\n\nUse functions and methods suffixed by `P` to provide a `\".\"` separated path.\n\n#### Get\n\n```json\n{\n\t\"index\": 0,\n\t\"name\": { \"first\": \"Tom\", \"last\": \"Anderson\" },\n\t\"friends\": [\n\t\t{ \"id\": 1, \"name\": \"Justine Bird\" },\n\t\t{ \"id\": 2, \"name\": \"Justine Rutledge\" },\n\t\t{ \"id\": 3, \"name\": \"Marianne Rutledge\" }\n\t]\n}\n```\n\nSummary of get operations on above data.\n\n```text\n\"name.last\"    \u003e\u003e \"Anderson\"                          // GET \"last\" field from \"name\" object\n\"friends.#\"    \u003e\u003e 3                                   // GET length of \"friends\" array\n\"friends.#~id\" \u003e\u003e [ 1, 2, 3 ]                         // GET all values of \"id\" field from \"friends\" array\n\"friends.#0\"   \u003e\u003e { \"id\": 1, \"name\": \"Justine Bird\" } // GET \"0th\" element from \"friends\" array\n```\n\n#### Set\n\nSet overwrites the existing data. An error will be returned if the data does not match the query. If the data is `nil`, it will create the structure.\n\nThere is an alternative for datatype mismatch. Use `SetF` instead of `Set` function. It will **forcefully** replace the existing with provided.\n\nFollowing path syntax sets \"Anderson\" as a value in empty structure.\n\n```text\n\"name.last\"    \u003e\u003e { \"name\": { \"last\": \"Anderson\" } }  // Create an object and SET value of \"last\" field in \"name\" object\n\"#2\"           \u003e\u003e [\"\", \"\", \"Anderson\"]                // Create an array and SET value at \"2nd\" index\n\"friends.#\"    \u003e\u003e { \"friends\": [ \"Anderson\" ] }       // Create an object and APPEND to \"friends\" array\n```\n\n#### Delete\n\nWhile deleting at an index, you have two options. By default, deletes does not preserve order. This helps to save unnecessary allocations as it just replaces the data at given index with last element. Refer following syntax for details.\n\n```json\n{\n\t\"index\": 0,\n\t\"friends\": [\"Justine Bird\", \"Justine Rutledge\", \"Marianne Rutledge\"]\n}\n```\n\nSummary of delete operations on above data.\n\n```text\n\"index\"        \u003e\u003e { \"friends\": [ \"Justine Bird\", \"Justine Rutledge\", \"Marianne Rutledge\" ] } // DELETE \"index\" field\n\"friends.#\"    \u003e\u003e { \"index\": 0, \"friends\": [ \"Justine Bird\", \"Justine Rutledge\" ] }          // DELETE last element from \"friends\" array\n\"friends.#0\"   \u003e\u003e { \"index\": 0, \"friends\": [ \"Marianne Rutledge\", \"Justine Rutledge\" ] }     // DELETE \"0th\" element from \"friends\" array WITHOUT preserving order\n\"friends.#~0\"  \u003e\u003e { \"index\": 0, \"friends\": [ \"Justine Rutledge\", \"Marianne Rutledge\" ] }     // DELETE \"0th\" element from \"friends\" array WITH preserving order\n```\n\n### Operations chaining\n\nYou can chain multiple operations and check if it succeeds or fails.\n\n```go\n    r := ijson.New(data).Get(\"#0\", \"friends\", \"#~name\").Del(\"#0\").Set(value, \"#\")\n    if r.Error() != nil {\n        ...\n    }\n\n    // access value\n    _ = r.Value()\n```\n\n### Parsing the json\n\nThis package uses standard library [encoding/json](https://golang.org/pkg/encoding/json/) as a json parser. We already have a very wide range of json parsers. I would recommend [GJSON](https://https://github.com/tidwall/gjson). It is probably the fastest, as far as I know.\n\nSee `ijson.ParseBytes()` and `ijson.Parse()` functions.\n\nPlease check following awesome projects, you might find a better match for you.\n\n1. [GJSON](https://github.com/tidwall/gjson), [SJSON](https://github.com/tidwall/sjson)\n2. [FASTJSON](https://github.com/valyala/fastjson)\n3. [GABS](https://github.com/Jeffail/gabs)\n\n## Contact\n\nAkshay Bharambe [@akshaybharambe1](http://twitter.com/akshaybharambe1)\n\n## License\n\nIJSON source code is available under the MIT [License](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshaybharambe14%2Fijson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshaybharambe14%2Fijson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshaybharambe14%2Fijson/lists"}