{"id":13413707,"url":"https://github.com/thedevsaddam/gojsonq","last_synced_at":"2025-05-14T01:07:30.732Z","repository":{"id":37335790,"uuid":"134077971","full_name":"thedevsaddam/gojsonq","owner":"thedevsaddam","description":"A simple Go package for querying over JSON, YAML, XML, and CSV data.","archived":false,"fork":false,"pushed_at":"2022-11-28T11:29:44.000Z","size":273,"stargazers_count":2207,"open_issues_count":26,"forks_count":140,"subscribers_count":31,"default_branch":"v2","last_synced_at":"2025-04-13T03:58:38.522Z","etag":null,"topics":["go-json","go-json-query","go-query","gojsonq","gojsonquery","golang-json","golang-json-query","golang-query","json","json-query","jsonq","query"],"latest_commit_sha":null,"homepage":"https://github.com/thedevsaddam/gojsonq/wiki","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/thedevsaddam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-19T16:15:18.000Z","updated_at":"2025-03-31T07:22:47.000Z","dependencies_parsed_at":"2022-07-12T12:04:27.572Z","dependency_job_id":null,"html_url":"https://github.com/thedevsaddam/gojsonq","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fgojsonq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fgojsonq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fgojsonq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fgojsonq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thedevsaddam","download_url":"https://codeload.github.com/thedevsaddam/gojsonq/tar.gz/refs/heads/v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661706,"owners_count":21141450,"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":["go-json","go-json-query","go-query","gojsonq","gojsonquery","golang-json","golang-json-query","golang-query","json","json-query","jsonq","query"],"created_at":"2024-07-30T20:01:47.001Z","updated_at":"2025-04-13T03:58:42.700Z","avatar_url":"https://github.com/thedevsaddam.png","language":"Go","funding_links":[],"categories":["Misc","开源类库","Go","查询语言","Open source library","Developer Tools \u0026 Libraries","Query Language","Go语言包管理","Relational Databases"],"sub_categories":["JSON","HTTP客户端","🚀 How to contribute","HTTP Clients","Advanced Console UIs","查询语","交流"],"readme":"![gojsonq-logo](gojsonq.png)\n\n[![Build Status](https://travis-ci.org/thedevsaddam/gojsonq.svg?branch=master)](https://travis-ci.org/thedevsaddam/gojsonq)\n[![Project status](https://img.shields.io/badge/version-v2-green.svg)](https://github.com/thedevsaddam/gojsonq/releases)\n[![Go Report Card](https://goreportcard.com/badge/github.com/thedevsaddam/gojsonq)](https://goreportcard.com/report/github.com/thedevsaddam/gojsonq)\n[![Coverage Status](https://coveralls.io/repos/github/thedevsaddam/gojsonq/badge.svg?branch=master)](https://coveralls.io/github/thedevsaddam/gojsonq)\n[![GoDoc](https://godoc.org/github.com/thedevsaddam/gojsonq?status.svg)](https://pkg.go.dev/github.com/thedevsaddam/gojsonq/v2)\n[![License](https://img.shields.io/dub/l/vibe-d.svg)](LICENSE.md)\n\nA simple Go package to Query over JSON Data. It provides [simple](https://github.com/thedevsaddam/gojsonq/wiki/Queries#jsonstringjson), [elegant](https://github.com/thedevsaddam/gojsonq/wiki/Queries#selectproperties) and [fast](https://github.com/thedevsaddam/gojsonq/wiki/Benchmark) [ODM](https://github.com/thedevsaddam/gojsonq/wiki/Queries#frompath) like API to access, query JSON document\n\n### Installation\n\nInstall the package using\n```go\n$ go get github.com/thedevsaddam/gojsonq/v2\n```\n\n### Usage\n\nTo use the package import it in your `*.go` code\n```go\nimport \"github.com/thedevsaddam/gojsonq/v2\"\n```\n\nLet's see a quick example:\n\n[See in playground](https://play.golang.org/p/UiqyllP2vkn)\n\n```go\npackage main\n\nimport gojsonq \"github.com/thedevsaddam/gojsonq/v2\"\n\nfunc main() {\n\tconst json = `{\"name\":{\"first\":\"Tom\",\"last\":\"Hanks\"},\"age\":61}`\n\tname := gojsonq.New().FromString(json).Find(\"name.first\")\n\tprintln(name.(string)) // Tom\n}\n```\n\nAnother example:\n\n[See in playground](https://play.golang.org/p/QLVxpi6nVbi)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tgojsonq \"github.com/thedevsaddam/gojsonq/v2\"\n)\n\nfunc main() {\n\tconst json = `{\"city\":\"dhaka\",\"type\":\"weekly\",\"temperatures\":[30,39.9,35.4,33.5,31.6,33.2,30.7]}`\n\tavg := gojsonq.New().FromString(json).From(\"temperatures\").Avg()\n\tfmt.Printf(\"Average temperature: %.2f\", avg) // 33.471428571428575\n}\n```\n\nYou can query your document using the various query methods such as **[Find](https://github.com/thedevsaddam/gojsonq/wiki/Queries#findpath)**, **[First](https://github.com/thedevsaddam/gojsonq/wiki/Queries#first)**, **[Nth](https://github.com/thedevsaddam/gojsonq/wiki/Queries#nthindex)**, **[Pluck](https://github.com/thedevsaddam/gojsonq/wiki/Queries#pluckproperty)**,  **[Where](https://github.com/thedevsaddam/gojsonq/wiki/Queries#wherekey-op-val)**, **[OrWhere](https://github.com/thedevsaddam/gojsonq/wiki/Queries#orwherekey-op-val)**, **[WhereIn](https://github.com/thedevsaddam/gojsonq/wiki/Queries#whereinkey-val)**, **[WhereStartsWith](https://github.com/thedevsaddam/gojsonq/wiki/Queries#wherestartswithkey-val)**, **[WhereEndsWith](https://github.com/thedevsaddam/gojsonq/wiki/Queries#whereendswithkey-val)**, **[WhereContains](https://github.com/thedevsaddam/gojsonq/wiki/Queries#wherecontainskey-val)**, **[Sort](https://github.com/thedevsaddam/gojsonq/wiki/Queries#sortorder)**,  **[GroupBy](https://github.com/thedevsaddam/gojsonq/wiki/Queries#groupbyproperty)**,  **[SortBy](https://github.com/thedevsaddam/gojsonq/wiki/Queries#sortbyproperty-order)** and so on. Also you can aggregate data after query using **[Avg](https://github.com/thedevsaddam/gojsonq/wiki/Queries#avgproperty)**,  **[Count](https://github.com/thedevsaddam/gojsonq/wiki/Queries#count)**, **[Max](https://github.com/thedevsaddam/gojsonq/wiki/Queries#maxproperty)**, **[Min](https://github.com/thedevsaddam/gojsonq/wiki/Queries#minproperty)**, **[Sum](https://github.com/thedevsaddam/gojsonq/wiki/Queries#sumproperty)** etc.\n\n## Find more query API in [Wiki page](https://github.com/thedevsaddam/gojsonq/wiki/Queries)\n\n## Bugs and Issues\n\nIf you encounter any bugs or issues, feel free to [open an issue at\ngithub](https://github.com/thedevsaddam/gojsonq/issues).\n\nAlso, you can shoot me an email to\n\u003cmailto:thedevsaddam@gmail.com\u003e for hugs or bugs.\n\n## Credit\n\nSpecial thanks to [Nahid Bin Azhar](https://github.com/nahid) for the inspiration and guidance for the package. Thanks to [Ahmed Shamim Hasan Shaon](https://github.com/me-shaon) for his support from the very beginning.\n\n## Contributors\n* [Lenin Hasda](https://github.com/leninhasda)\n* [Sadlil Rhythom](https://github.com/sadlil)\n* [See contributors list here](https://github.com/thedevsaddam/gojsonq/graphs/contributors)\n\n## Contribution\nIf you are interested to make the package better please send pull requests or create an issue so that others can fix.\n[Read the contribution guide here](CONTRIBUTING.md)\n\n## License\nThe **gojsonq** is an open-source software licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedevsaddam%2Fgojsonq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedevsaddam%2Fgojsonq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedevsaddam%2Fgojsonq/lists"}