Description
This library is very close to mongodb's dot notation with a bit of extension.
jsonpath alternatives and similar packages
Based on the "Specific Formats" category.
Alternatively, view jsonpath alternatives based on common mentions on social networks and blogs.
-
bluemonday
bluemonday: a fast golang HTML sanitizer (inspired by the OWASP Java HTML Sanitizer) to scrub user generated content of XSS -
html-to-markdown
โ๏ธ Convert HTML to Markdown. Even works with entire websites and can be extended through rules. -
omniparser
omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc. -
mxj
Decode / encode XML to/from map[string]interface{} (or JSON); extract values with dot-notation paths and wildcards. Replaces x2j and j2x packages. -
go-pkg-rss
DISCONTINUED. This package reads RSS and Atom feeds and provides a caching mechanism that adheres to the feed specs. -
goq
A declarative struct-tag-based HTML unmarshaling or scraping package for Go built on top of the goquery library -
gospider
DISCONTINUED. โก Light weight Golang spider framework | ่ฝป้็ Golang ็ฌ่ซๆกๆถ [GET https://api.github.com/repos/zhshch2002/gospider: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository] -
github_flavored_markdown
GitHub Flavored Markdown renderer with fenced code block highlighting, clickable header anchor links. -
go-pkg-xmlx
DISCONTINUED. Extension to the standard Go XML package. Maintains a node tree that allows forward/backwards browsing and exposes some simple single/multi-node search functions. -
pagser
Pagser is a simple, extensible, configurable parse and deserialize html page to struct based on goquery and struct tags for golang crawler -
csvplus
csvplus extends the standard Go encoding/csv package with fluent interface, lazy stream operations, indices and joins.
CodeRabbit: AI Code Reviews for Developers

Do you think we are missing an alternative of jsonpath or a related project?
Popular Comparisons
README
jsonpath - Json generation by dot notation
This library is very close to mongodb's dot notation with a bit of extensions.
Supported syntaxes
Standard dot notation
input hash value | output json result |
---|---|
{"0.value":"100"} | [{"value":"100"}] |
{"1.value":"100"} | [null, {"value":"100"}] |
{"value":"100"} | {"value":"100"} |
{"value.1":"100"} | {"value":[null, "100"]} |
{"v.0.k":"100"} | {"v":[{"k":100}]} |
Extended
input hash value | output json result |
---|---|
{"v.num()":"1.0"} | {"v":1.0} |
{"v.bool()":"true"} | {"v":true} |
Benchmarks
Run benchmarks
go test -bench=.
Results
v0.0.3
BenchmarkComplexJSONPathArray-8 100000 12480 ns/op
BenchmarkSimpleJSONPathArrayWithNum-8 500000 2654 ns/op
BenchmarkSimpleJSONPathArrayWithBool-8 1000000 2319 ns/op
BenchmarkSimpleJSONPathArrayInsideArray-8 500000 3066 ns/op
BenchmarkSimpleJSONPathArrays-8 500000 2636 ns/op
BenchmarkSimpleJSONPathSimple-8 1000000 1626 ns/op
BenchmarkJSONNative-8 2000000 959 ns/op
Installation
go get github.com/cthulhu/jsonpath
Usage
in := map[string]string{"0.value": "100.00"}
jsobBytes := jsonpath.Marshal(in)
For more examples check jsonpath_test.go file
LICENSE
See LICENSE file
*Note that all licence references and agreements mentioned in the jsonpath README section above
are relevant to that project's source code only.