cratesland/spath: Query expressions for semi-structured data

cratesland/spath: Query expressions for semi-structured data | line4k – The Ultimate IPTV Experience – Watch Anytime, Anywhere

Streaming Service Promotion

Ready for uninterrupted streaming? Visit us for exclusive deals!
netflix youtubetv starzplay skysport showtime primevideo appletv amc beinsport disney discovery hbo global fubotv
netflix youtubetv starzplay skysport showtime primevideo appletv amc beinsport disney discovery hbo global fubotv

You can use it as a drop-in replacement for JSONPath, but also for other semi-structured data formats like TOML or user-defined variants.

Here is a quick example that shows how to use the spath crate to query JSONPath alike expression over JSON data:

use serde_json::json;
use serde_json::Value as JsonValue;
use spath::SPath;
use spath::Value;

fn main() {
    let data = json!({
        "name": "John Doe",
        "age": 43,
        "phones": [
            "+44 1234567",
            "+44 2345678"
        ]
    });

    let spath = SPath::new("$.phones[1]").unwrap();
    let value = Value::from(data);
    let result = spath.eval(&value).unwrap();
    assert_eq!(JsonValue::from(result), json!("+44 2345678"));
}

spath is on crates.io and can be used by adding spath to your dependencies in your project’s Cargo.toml. Or more simply, just run cargo add spath.

This project is licensed under Apache License, Version 2.0.

Premium IPTV Experience with line4k

Experience the ultimate entertainment with our premium IPTV service. Watch your favorite channels, movies, and sports events in stunning 4K quality. Enjoy seamless streaming with zero buffering and access to over 10,000+ channels worldwide.

Live Sports & Events in 4K Quality
24/7 Customer Support
Multi-device Compatibility
Start Streaming Now
Sports Channels


line4k

Premium IPTV Experience • 28,000+ Channels • 4K Quality


28,000+

Live Channels


140,000+

Movies & Shows


99.9%

Uptime

Start Streaming Today

Experience premium entertainment with our special trial offer


Get Started Now

Scroll to Top