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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for cognite_kuiper-0.11.1-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a420da5e2567ee797ec3bd5901bbe59c3185440e4644835a8f4dbe36eee0bb0 |
|
MD5 | 4b5e15faf24f9ab5abb0a7fa5e5f46e2 |
|
BLAKE2b-256 | 5304abacfa6da3f5fb98a03bed15cbefa92db5fbb284491cd07c6f139bde8149 |
Hashes for cognite_kuiper-0.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a92b1f3e97fe144aaed4356f91f49874edb4f8bcd2b27d94dc59753abff0205b |
|
MD5 | 2321656aab333082fc03d61cb9b63643 |
|
BLAKE2b-256 | c6d2bfcb6d415cda9865665436b4c2159f854974d538e7bde9cf57f09c67fcfe |
Hashes for cognite_kuiper-0.11.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed47da483b86354a8aad675962cf40862eeadcec236dbca63153c38d96930f0f |
|
MD5 | e2ef09bdb1c55e217672eefd8c53956c |
|
BLAKE2b-256 | b5167690563bd295049257ba68a66aac70262d9bdc7cf92d7bf97f161b9aad17 |
Hashes for cognite_kuiper-0.11.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09aa278c7c74438b6d6462fca60aedc6a2414235d2c85be96794c7d015366ae8 |
|
MD5 | 903499423863a4acc104d38e435b2199 |
|
BLAKE2b-256 | 31fa664fcf76affe2a10dda4a33cf9cd7585604a40af208690462b091efe03e9 |
Hashes for cognite_kuiper-0.11.1-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef40125b2746052610a2078112a3cf10b2f088d151a9f3dfb4ccc51e365b4adb |
|
MD5 | 3264b215b6df46b4323a79deca31f0db |
|
BLAKE2b-256 | 04ada364fb40e5e591b25b8a7012c34879b0d188bb5b85dfb9d04cc38ffd2c92 |
Hashes for cognite_kuiper-0.11.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c08c036e0e6ebaad6c3fa9f6821cd8b3659b26d91c4703bb78b0886aa2b48049 |
|
MD5 | 33fa26bd8182c3ef7537c1f9e596aaf7 |
|
BLAKE2b-256 | 8aa2a7afd76241d043dbe9f8f87b90d38a5ef5a94844e52e20be4e8df6a05833 |
Hashes for cognite_kuiper-0.11.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b04c76577ed88a2f0249cd3b23750449bed1d79825afee07a78984414f2cff50 |
|
MD5 | 2092e23721b716c26a7997209803898b |
|
BLAKE2b-256 | 5fe13a4f4eca0c1a739e1abae3b0218b83f08c73755a4d2ba36e51017abd6a7f |
Hashes for cognite_kuiper-0.11.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 640d163e5cd75341231f0210fd8854408b628a555a196bb7c37c3b891443c8da |
|
MD5 | a82b6907a6e25e797e8c1284f3a76b76 |
|
BLAKE2b-256 | 98b17ec3a368d768e408450c801440372662980a20352aff70a050152a56bf95 |
Hashes for cognite_kuiper-0.11.1-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b8a951a076f824e83c8c47792d1201d9c520e224dfd3c7add5ee8d54009e86 |
|
MD5 | a2cd2abefbf08ef2da7dd11fde43a09c |
|
BLAKE2b-256 | de1a6568b212f59b9b134e7166aa5f073664f9c46f023c6be8d7553c14a5d299 |
Hashes for cognite_kuiper-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb6781bcf4f822c6a591200e04471c10da235cb30832cf257948001580dfe1fa |
|
MD5 | aba4e93eef5f4de58f76a1449c31a316 |
|
BLAKE2b-256 | 1e957c2d7d13527aad32c0406ff0a65e4037e72223f28c96a93d3d09e553bebd |
Hashes for cognite_kuiper-0.11.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc9b304eb9dc247b755013fb380f87fa5c4e7424c11ab490259bb6bec56b5f34 |
|
MD5 | 4f93acd90eaace57e154dc1791b87e14 |
|
BLAKE2b-256 | bc3b3948063a92344958adec234edd5ca2b67733fa6ed21beea12918b7beda97 |
Hashes for cognite_kuiper-0.11.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb773bf62c2a7eea352f366290c9a0f1c1326a0bde19e2aec009e5aa35d01810 |
|
MD5 | c4c8a559ecfbe00e97acf929896e68a9 |
|
BLAKE2b-256 | 6c6bf3f290f3ace3cfcad88b66e788a57f3d91352d1643e512e8f9a91ef19718 |