skillfed

cql2

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

cql2 v0.6.0 121.0K downloads/30d#12,001 on PyPI23
Permissive license MIT Active released

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 on this page — 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

cql2 on PyPI

pip

pip install cql2

uv

uv add cql2

poetry

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 the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 121,001/month — #12,001 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cql2-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl; cql2-0.6.0-cp310-abi3-macosx_11_0_arm64.whl; cql2-0.6.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; cql2-0.6.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; cql2-0.6.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl; cql2-0.6.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; cql2-0.6.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl; cql2-0.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; cql2-0.6.0-cp310-abi3-musllinux_1_2_aarch64.whl; cql2-0.6.0-cp310-abi3-musllinux_1_2_armv7l.whl; cql2-0.6.0-cp310-abi3-musllinux_1_2_i686.whl; cql2-0.6.0-cp310-abi3-musllinux_1_2_x86_64.whl; cql2-0.6.0-cp310-abi3-win32.whl; cql2-0.6.0-cp310-abi3-win_amd64.whl

Keywords: cql2

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Rust

Tags

cql2 parsercommon query language conversioncql2 to sqlquery language parsercql2 json text conversionogc cql2 libraryquery expression parser
query-parsingogc-standardrust-bindings

More Text Processing packages