greyblake / Jsonpath Rs
Licence: mit
JSONPath for Rust
Stars: ✭ 31
Programming Languages
rust
11053 projects
Projects that are alternatives of or similar to Jsonpath Rs
Univalue
High performance RAII C++ JSON library and universal value object class
Stars: ✭ 46 (+48.39%)
Mutual labels: json, json-parser, json-data
Lazyjson
A very fast, very lazy JSON parser for Java.
Stars: ✭ 55 (+77.42%)
Mutual labels: json, json-parser, json-data
Dictfier
Python library to convert/serialize class instances(Objects) both flat and nested into a dictionary data structure. It's very useful in converting Python Objects into JSON format
Stars: ✭ 67 (+116.13%)
Mutual labels: json, json-parser, json-data
Argonaut
Purely functional JSON parser and library in scala.
Stars: ✭ 501 (+1516.13%)
Mutual labels: json, json-parser
Coolie
Coolie(苦力) helps you to create models (& their constructors) from a JSON file.
Stars: ✭ 508 (+1538.71%)
Mutual labels: json, json-parser
Jsonui
jsonui is an interactive JSON explorer on your command line
Stars: ✭ 583 (+1780.65%)
Mutual labels: json, json-parser
Ems
Extended Memory Semantics - Persistent shared object memory and parallelism for Node.js and Python
Stars: ✭ 552 (+1680.65%)
Mutual labels: json, json-data
Jsonlite
A simple, self-contained, serverless, zero-configuration, json document store.
Stars: ✭ 819 (+2541.94%)
Mutual labels: json, json-data
Swiftyjson
The better way to deal with JSON data in Swift.
Stars: ✭ 21,042 (+67777.42%)
Mutual labels: json, json-parser
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (+1312.9%)
Mutual labels: json, xpath
Fastjson
A fast JSON parser/generator for Java.
Stars: ✭ 23,997 (+77309.68%)
Mutual labels: json, json-parser
Flatcc
FlatBuffers Compiler and Library in C for C
Stars: ✭ 434 (+1300%)
Mutual labels: json, json-parser
Pikkr
JSON parser which picks up values directly without performing tokenization in Rust
Stars: ✭ 580 (+1770.97%)
Mutual labels: json, json-parser
Xml Js
Converter utility between XML text and Javascript object / JSON text.
Stars: ✭ 874 (+2719.35%)
Mutual labels: json, json-parser
Data
This repository contains general data for Web technologies
Stars: ✭ 418 (+1248.39%)
Mutual labels: json, json-data
JSONPath for Rust
The library is in hard development stage.
Example
extern crate jsonpath;
extern crate serde_json;
use jsonpath::Selector;
use serde_json::Value;
fn main() {
let jsondoc = r#"
{
"books": [
{
"title": "Der schwarze Obelist",
"author": "Erich Maria Remarque"
},
{
"title": "Le mur",
"author": "Jean-Paul Sartre"
}
]
}
"#;
// Parse JSON document
let json: Value = serde_json::from_str(jsondoc).unwrap();
// Create a JSONPath selector
let selector = Selector::new("$.books.*.title").unwrap();
// Apply the selector to the JSON and convert Vec<&Value> into Vec<&str>
let titles: Vec<&str> = selector.find(&json)
.map(|t| t.as_str().unwrap())
.collect();
assert_eq!(titles, vec!["Der schwarze Obelist", "Le mur"]);
}
Roadmap
- [ ] Operators:
- [x]
$
- root element - [x]
.<name>
- named child element - [x]
*
- wildcard (any child item) - [x]
[<number>]
- indexed element in array - [x]
[<start>:<end>]
- slice - [x]
[:<end>]
- slice (to) - [x]
[<start>:]
- slice (from)
- [x]
- [ ] Handy test helpers
- [ ] Good integration test coverage
- [ ] Benchmarks
- [ ] Refactor
- [ ] Improve error messages
- [ ] Review unwraps
- [ ] Review the public API (rename Selector -> Path ?)
- [ ] Publish a new version
- [ ] Mutable iterator
- [x] Support filters
- [x]
[?(<expression>)]
- Filter expression. Expression must evaluate to a boolean value. - [x]
@
- current element - [x] operator
==
- [x] operator
!=
- [x] operator
>
- [x] operator
<
- [x] operator
>=
- [x] operator
<=
- [ ] operator
=~
- [x] filter comparison with expression on the right side
[?(<exporession> <operator> <expression>)]
- [x] string
- [x] float
- [x] integer
- [x] array of string
- [ ] array of float
- [ ] array of number
- [ ] sub script expression
()
- [ ] and operator
&&
- [ ] or operator
||
- [x]
Supported Rust versions
Jsonpath requires rust version 1.26 or higher.
License
Contributors
- greyblake Sergey Potapov - creator, maintainer.
- MarcAntoine-Arnaud Marc-Antoine ARNAUD - filters support
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].