You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cql2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cql2

Parse, validate, and convert Common Query Language (CQL2) text and JSON

0.3.7
pipPyPI
Maintainers
1

cql2

Python library and command-line interface (CLI) for parsing and converting Common Query Language (CQL2), with Rust under the hood.

Usage

pip install cql2

Then:

expr = Expr("landsat:scene_id = 'LC82030282019133LGN00'")
# or
expr = cql2.parse_file("fixtures/text/example01.txt")

s = expr.to_text()
d = expr.to_json()
sql = expr.to_sql()
print("SQL query:", sql.query)
print("SQL params:", sql.params)

Or from via the command-line interface:

$ cql2 -o json "landsat:scene_id = 'LC82030282019133LGN00'"
{"op":"=","args":[{"property":"landsat:scene_id"},"LC82030282019133LGN00"]}

Developing

To install the package to your virtual environment and test:

maturin develop --uv -m python/Cargo.toml && pytest python

More information

This package is part of cql2-rs, see that repo for license and contributing information.

Keywords

cql2

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts