Metadata-Version: 2.4
Name: cognite-kuiper
Version: 0.18.1
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python
Requires-Dist: pytest ; extra == 'test'
Provides-Extra: test
Summary: A JSON to JSON transform and templating language from Cognite
Keywords: JSON,transformation
Author-email: Mathias Lohne <mathias.lohne@cognite.com>
Maintainer-email: Mathias Lohne <mathias.lohne@cognite.com>
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: homepage, https://cognite.com
Project-URL: repository, https://github.com/cognitedata/kuiper

# Python bindings for Kuiper

Python bindings for Kuiper so you can compile and run transformations from a
Python runtime.

``` python
from kuiper import compile_expression

expression = compile_expression('{"theAnswer": input.numericValue + 27}', ["input"])
value = expression.run('{"numericValue": 15}')
print(value)
```

The `compile_expression` function might raise a `KuiperCompileError`, and
otherwise returns a `KuiperExpression` object. The `KuiperExpression.run(...)`
method might raise a `KuiperRuntimeError`. Both of these exceptions are
subclasses of the `KuiperError` base class.

## Development

We use [PyO3](https://pyo3.rs) to create the bindings.

This project uses [maturin](https://www.maturin.rs/) to manage dependencies and
such, instead of poetry. To set up your local development environment, first
make sure maturin is installed:

``` commanline
pip install -U maturin
```

Then, you can enter or exit a virtual environment with the `kuiper` package
installed by sourcing the `enter.sh` or `exit.sh` scripts:

``` commandline
source enter.sh
```

``` commandline
source exit.sh
```

Whenever you change the code, you need to rebuild. Instead of using `cargo`
directly, use `maturin`:

``` commandline
maturin develop
```

This will build and install the python package into the current environment,
which is the virtual environment created by the `enter.sh` script.

