Skip to main content

A JSON to JSON transform and templating language from Cognite

Project description

Python bindings for Kuiper

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

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 to create the bindings.

This project uses maturin to manage dependencies and such, instead of poetry. To set up your local development environment, first make sure maturin is installed:

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:

source enter.sh
source exit.sh

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cognite_kuiper-0.11.1-cp312-none-win_amd64.whl (498.7 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

cognite_kuiper-0.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (705.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cognite_kuiper-0.11.1-cp312-cp312-macosx_11_0_arm64.whl (613.9 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

cognite_kuiper-0.11.1-cp312-cp312-macosx_10_12_x86_64.whl (640.6 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

cognite_kuiper-0.11.1-cp311-none-win_amd64.whl (499.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

cognite_kuiper-0.11.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (707.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cognite_kuiper-0.11.1-cp311-cp311-macosx_11_0_arm64.whl (614.7 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

cognite_kuiper-0.11.1-cp311-cp311-macosx_10_12_x86_64.whl (642.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

cognite_kuiper-0.11.1-cp310-none-win_amd64.whl (500.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

cognite_kuiper-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (708.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cognite_kuiper-0.11.1-cp310-cp310-macosx_11_0_arm64.whl (615.3 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

cognite_kuiper-0.11.1-cp310-cp310-macosx_10_12_x86_64.whl (642.6 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page