cql2-rs
cql-rs is command-line interface (CLI), Python package, and Rust crate for parsing, validating, and converting Common Query Language (CQL2).
CLI
To install the CLI, you'll need Rust. Then:
$ cargo install cql2-cli
$ cql2 -o json "landsat:scene_id = 'LC82030282019133LGN00'"
{"op":"=","args":[{"property":"landsat:scene_id"},"LC82030282019133LGN00"]}
Python
Install with pip:
Then:
See the API documentation for more.
Rust
Add cql2 to your dependencies:
Then:
use cql2::Expr;
let expr: Expr = "landsat:scene_id = 'LC82030282019133LGN00'".parse().unwrap();
assert!(expr.is_valid());
let json = expr.to_json().unwrap();
See the API documentation for more.