-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,129 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Docs | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
env: | ||
GIT_COMMITTER_NAME: ci-bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- name: Install Python | ||
run: uv python install # we use uv instead of setup-python so we get python-version resolution between our two packages | ||
- name: Sync | ||
run: uv sync | ||
- name: Deploy | ||
run: | | ||
VERSION=$(git describe --tags --match="v*" --abbrev=0) | ||
uv run mike deploy $VERSION latest --update-aliases --push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
target/ | ||
debug/ | ||
**/*.rs.bk | ||
.cache | ||
site/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# cql2-rs | ||
|
||
**cql-rs** is command-line interface (CLI), Python package, and Rust crate for parsing, validating, and converting [Common Query Language (CQL2)](https://www.ogc.org/standard/cql2/). | ||
|
||
## CLI | ||
|
||
To install the CLI, you'll need [Rust](https://rustup.rs/). | ||
Then: | ||
|
||
```shell | ||
$ cargo install cql2-cli | ||
$ cql2 -o json "landsat:scene_id = 'LC82030282019133LGN00'" | ||
{"op":"=","args":[{"property":"landsat:scene_id"},"LC82030282019133LGN00"]} | ||
``` | ||
|
||
## Python | ||
|
||
Install with **pip**: | ||
|
||
```shell | ||
pip install cql2 | ||
``` | ||
|
||
Then: | ||
|
||
```python | ||
from cql2 import Expr | ||
expr = Expr("landsat:scene_id = 'LC82030282019133LGN00'") | ||
d = expr.to_json() | ||
``` | ||
|
||
See [the API documentation](./python.md) for more. | ||
|
||
## Rust | ||
|
||
Add **cql2** to your dependencies: | ||
|
||
```shell | ||
cargo add cql2 | ||
``` | ||
|
||
Then: | ||
|
||
```rust | ||
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](https://docs.rs/cql2) for more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Python | ||
|
||
Python API documentation for the **cql2** package. | ||
Install from PyPI: | ||
|
||
```shell | ||
pip install cql2 | ||
``` | ||
|
||
## API | ||
|
||
::: cql2.Expr | ||
::: cql2.SqlQuery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
site_name: cql2-rs | ||
site_url: https://developmentseed.org/cql2-rs/ | ||
site_description: Command-line interface (CLI), Python package, and Rust crate for parsing, validating, and converting Common Query Language (CQL2) | ||
site_author: David Bitner | ||
repo_name: developmentseed/cql2-rs | ||
repo_url: https://github.com/developmentseed/cql2-rs | ||
|
||
extra: | ||
social: | ||
- icon: "fontawesome/brands/github" | ||
version: | ||
provider: mike | ||
|
||
theme: | ||
name: material | ||
logo: ds-logo-hor--pos.svg | ||
favicon: favicon.png | ||
palette: | ||
primary: blue | ||
features: | ||
- navigation.indexes | ||
- navigation.instant | ||
- navigation.tracking | ||
- search.suggest | ||
- search.share | ||
nav: | ||
- cql2-rs: index.md | ||
- Python: python.md | ||
plugins: | ||
- search | ||
- social | ||
- mike: | ||
alias_type: "copy" | ||
canonical_version: "latest" | ||
- mkdocstrings: | ||
enable_inventory: true | ||
handlers: | ||
python: | ||
options: | ||
allow_inspection: false | ||
show_root_heading: true | ||
separate_signature: false | ||
docstring_style: google | ||
docstring_section_style: list | ||
show_symbol_type_toc: true | ||
signature_crossrefs: true | ||
merge_init_into_class: true | ||
docstring_options: | ||
ignore_init_summary: false | ||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
line_spans: __span | ||
pygments_lang_class: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[project] | ||
name = "cql2-rs" | ||
version = "0.0.0" | ||
description = "This Python package is non-releaseable and is only used for building the documentation" | ||
requires-python = ">=3.12" | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"mike>=2.1.3", | ||
"mkdocs-material[imaging]>=9.5.39", | ||
"mkdocstrings[python]>=0.26.1", | ||
] | ||
|
||
[tool.uv.sources] | ||
python = { workspace = true } | ||
|
||
[tool.uv.workspace] | ||
members = ["python/"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.