Python bindings to Rust jrsonnet crate
Low maintenance activity. Last release 23 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install rjsonnetREADME as published on PyPI with version 0.5.6.
rjsonnet-py
Python bindings to Rust jrsonnet crates (Rust implementation of Jsonnet language).
Installation
pip install rjsonnet
Usage
This module provides two functions:
def evaluate_file(filename: str) -> str: ...def evaluate_snippet(filename: str, src: str) -> str: ...
In the latter case, the parameter filename is used in stack traces,
because all errors are given with the "filename" containing the code.
Keyword arguments to these functions are used to control the virtual machine. They are:
max_stack(number)gc_min_objects(number, ignored)gc_growth_trigger(number, ignored)ext_vars(dict, string to string)ext_codes(dict, string to string)tla_vars(dict, string to string)tla_codes(dict, string to string)max_trace(number)import_callback(see example in tests/)native_callbacks(see example in tests/)preserve_order(bool, preserve object field order during manifestification)gc(bool, default:True, run garbage collection automatically)
The argument import_callback can be used to pass a callable, to trap the Jsonnet import and importstr constructs.
This allows, e.g., reading files out of archives or implementing library search paths.