A command-line tool and Rust library for fast querying of JSON, YAML, TOML, and other documents using regular path expressions.
jsongrep is a command-line tool and Rust library for querying structured data formats like JSON, YAML, TOML, and others using regular path expressions. It allows developers to declaratively describe and match paths through document trees to extract specific data efficiently, solving the problem of verbose or complex queries in tools like jq.
Developers, data engineers, and system administrators who work with structured configuration files, API responses, or serialized data and need to quickly extract, filter, or explore nested data without writing complex transformation pipelines.
jsongrep offers a fast, declarative path-matching syntax that compiles to efficient automata, supports multiple serialization formats natively, and provides clear path context for matches—making it simpler and more performant for many data extraction tasks compared to transformation-based alternatives.
A path query language for JSON, YAML, TOML, and other serialization formats.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Queries compile to deterministic finite automata (DFA), resulting in fast execution benchmarked against tools like jq, with significant speed advantages on large datasets such as the 190 MB GeoJSON file.
Supports JSON, YAML, TOML, JSONL, CBOR, and MessagePack with auto-detection, allowing identical query syntax across formats without manual conversion, as shown in examples querying Cargo.toml and docker-compose.yml.
Uses regular path expressions with operators like Kleene star and disjunction, making queries concise for tasks like extracting fields at any depth, which is more verbose in jq.
Displays the exact location (e.g., prizes.[0].laureates.[0].firstname) for each match, aiding in debugging and data exploration, a feature not default in jq.
The regex syntax for field name patterns (/regex/) is experimental and not fully implemented, limiting advanced pattern matching capabilities that users might expect.
Uses a non-standard regular path expression syntax rather than widely adopted JSONPath, requiring learning a new language and potentially hindering interoperability with other tools.
Library usage requires a Rust environment, adding complexity for integration into non-Rust projects compared to language-agnostic CLI tools, though the CLI itself is standalone.
jsongrep is an open-source alternative to the following products: