--- id: cql2 version: "0.6.0" license: MIT license_treatment: permissive maintenance: active --- # cql2 — Parse, validate, and convert Common Query Language (CQL2) text and JSON License: permissive · Maintenance: active · Downloads: 121.0K/mo ## What it is and what it does cql2 is a Python binding to a Rust implementation of the OGC Common Query Language (CQL2) standard. It lets you parse CQL2 query expressions from text or files and convert them into multiple output formats—text, JSON, or SQL—making it useful for applications that need to accept user-friendly query syntax and translate it into database-specific query languages. The package provides both a Python API and a command-line tool. It has no runtime dependencies beyond Python itself, though installation requires pre-built wheels or a Rust toolchain to compile. It supports Python 3.10 through 3.14 and is actively maintained. Use it for: - Convert user-supplied CQL2 query strings into SQL for database backends in geospatial or data-discovery applications - Parse and validate CQL2 expressions in REST APIs that accept OGC-compliant query filters - Transform CQL2 text queries into JSON representation for downstream processing or storage - Build CLI tools that accept CQL2 syntax and emit SQL or other query formats ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses, validates, and converts Common Query Language (CQL2) expressions between text, JSON, and SQL formats using a Rust backend. Yes. The package is actively maintained, has no security vulnerabilities, carries a permissive MIT license, and solves a specific standards-based problem (CQL2 parsing and conversion). Medium install friction is acceptable given the pre-built wheels for common platforms. Install if you need to parse or convert CQL2 expressions; skip if you don't work with OGC query standards. ## Install pip install cql2 uv add cql2 poetry add cql2 ## Installing cql2 Before you install: Medium install friction due to compiled Rust bindings, but pre-built wheels cover common platforms (macOS, Linux, Windows, multiple architectures). Active maintenance with a release within the last day. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install cql2 from cql2 import Expr expr = Expr("landsat:scene_id = 'LC82030282019133LGN00'") print(expr.to_sql()) Requires Python 3.10 or later; compiled wheels available for common platforms but may require compilation on unsupported architectures. Verify before relying: - Whether the CLI is automatically available after pip install or requires additional setup - Performance characteristics for large or complex CQL2 expressions - Completeness of CQL2 standard coverage in this implementation ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 121.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cql2 parser, common query language conversion, cql2 to sql, query language parser, cql2 json text conversion, ogc cql2 library, query expression parser, query-parsing, ogc-standard, rust-bindings [View on SkillFed](https://skillfed.io/packages/cql2) · [View on PyPI](https://pypi.org/project/cql2/)