Skip to main content

JsonLogic implemented with a Rust backend

Project description

json-logic-rs

Continuous Integration

This s an implementation of the JSONLogic specification in Rust.

Building

Prerequisites

You must have Rust installed and cargo available in your PATH.

If you would like to build or test the Python distribution, Python 3.6 or newer must be available in your PATH. The venv module must be part of the Python distribution (looking at you, Ubuntu).

If you would like to run tests for the WASM package, node 10 or newer must be available in your PATH.

Rust

To build the Rust library, just run cargo build.

You can create a release build with make build.

WebAssembly

You can build a debug WASM release with

make debug-wasm

You can build a production WASM release with

make build-wasm

The built WASM package will be in js/. This package is directly importable from node, but needs to be browserified in order to be used in the browser.

Python

To perform a dev install of the Python package, run:

make develop-py

This will automatically create a virtual environment in venv/, install the necessary packages, and then install jsonlogic_rs into that environment.

Note: from our CI experiences, this may not work for Python 3.8 on Windows. If you are running this on a Windows machine and can confirm whether or not this works, let us know!

To build a production source distribution:

make build-py-sdist

To build a wheel (specific to your current system architecture and python version):

make build-py-wheel

The python distribution consists both of the C extension generated from the Rust and a thin wrapper found in py/jsonlogic_rs/. make develop-py will compile the C extension and place it in that directory, where it will be importable by your local venv. When building wheels, the wrapper and the C extension are all packaged together into the resultant wheel, which will be found in dist/. When building an sdist, the Rust extension is not compiled. The Rust and Python source are distributed together in a .tar.gz file, again found in dist/.

Project details


Download files

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

Source Distribution

jsonlogic-rs-0.1.0.tar.gz (30.7 kB view details)

Uploaded Source

File details

Details for the file jsonlogic-rs-0.1.0.tar.gz.

File metadata

  • Download URL: jsonlogic-rs-0.1.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for jsonlogic-rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9d5189b35639f88194d788994b740361e3a2f4d314fa07a12f01822d5eeb227
MD5 a1d8f6d0598e9fa9e05db2e48ea7d765
BLAKE2b-256 0fa3621a281ef968246ef77e50e8f6ae4775f32807cf0b265e79d3194495bffd

See more details on using hashes here.

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