All Projects → greyblake → Jsonpath Rs

greyblake / Jsonpath Rs

Licence: mit
JSONPath for Rust

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
Json
JSON for Modern C++
Stars: ✭ 27,824 (+89654.84%)
Mutual labels:  json, json-parser
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
Jstream
Streaming JSON parser for Go
Stars: ✭ 427 (+1277.42%)
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
Djson
Fast Go decoder for dynamic JSON
Stars: ✭ 588 (+1796.77%)
Mutual labels:  json, json-parser
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
Jsonq
A PHP query builder for JSON
Stars: ✭ 729 (+2251.61%)
Mutual labels:  json, json-data
Defiant.js
http://defiantjs.com
Stars: ✭ 907 (+2825.81%)
Mutual labels:  json, xpath
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.

Build Status

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)
  • [ ] 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 ||

Supported Rust versions

Jsonpath requires rust version 1.26 or higher.

License

MIT © Sergey Potapov

Contributors

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].