An expression language.
Project description
jsonexpr for Python
This document describes using jsonexpr with Python. For the language overview, see the main page.
Installation
pip3 install jsonexpr
Python 3.8 and later are supported.
Example
import jsonexpr
compiled = jsonexpr.compile("""
PRINT("I have " + LEN(grades) + " students");
PRINT("Alice's grade is " + grades.alice);
""")
compiled.setSymbols({
"grades" : {
"alice" : "A",
"bob" : "B",
}
});
result = compiled.eval()
Output:
I have 2 students
Alice's grade is A
License
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 Distribution
jsonexpr-0.0.15.tar.gz
(121.5 kB
view details)
File details
Details for the file jsonexpr-0.0.15.tar.gz
.
File metadata
- Download URL: jsonexpr-0.0.15.tar.gz
- Upload date:
- Size: 121.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b020a9613879470184e9bed075415cad98b0327d927e3fbddf4efabbc969ecf |
|
MD5 | 8a11165bd47e9312908c6e0f53128962 |
|
BLAKE2b-256 | b0c69199fe740b476b1880a6cd0eed97f6cb43ad18bffd814303b97bfb8e7e49 |