7 releases (breaking)
Uses new Rust 2024
| 0.5.0 | Jan 19, 2026 |
|---|---|
| 0.4.0 | Jul 10, 2025 |
| 0.3.0 | Feb 24, 2022 |
| 0.2.0 | Aug 26, 2017 |
| 0.0.1 | Jan 31, 2016 |
#45 in Database interfaces
128,973 downloads per month
Used in 36 crates
(24 directly)
170KB
4K
SLoC
JMESPath for Rust
Rust implementation of JMESPath, a query language for JSON.
Installing
This crate is on crates.io and can be used
by adding jmespath to the dependencies in your project's Cargo.toml.
[dependencies]
jmespath = "0.5"
If you are using a nightly compiler, or reading this when specialization in Rust
is stable (see rust#31844), then
enable the specialized feature to switch on usage of specialization to get more
efficient code:
[dependencies.jmespath]
version = "0.5"
features = ["specialized"]
Examples
extern crate jmespath;
let expr = jmespath::compile("foo.bar").unwrap();
// Parse some JSON data into a JMESPath variable
let json_str = r#"{"foo": {"bar": true}}"#;
let data = jmespath::Variable::from_json(json_str).unwrap();
// Search the data with the compiled expression
let result = expr.search(data).unwrap();
assert_eq!(true, result.as_boolean().unwrap());
Dependencies
~0.3–1MB
~19K SLoC