Skip to main content

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

Apache 2.0

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

jsonexpr-0.0.23.tar.gz (123.6 kB view details)

Uploaded Source

File details

Details for the file jsonexpr-0.0.23.tar.gz.

File metadata

  • Download URL: jsonexpr-0.0.23.tar.gz
  • Upload date:
  • Size: 123.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for jsonexpr-0.0.23.tar.gz
Algorithm Hash digest
SHA256 0140d86f0e652ddf923662a2f534dad947e3717e02de6e7f25d80bc17891bf9c
MD5 e67e3699821bc502a22d5b5dfbce8d92
BLAKE2b-256 fd8e0b5af3c36d617df3ba85f5ff8567acf811c5fdce93f820c10ee4bbbf8c3c

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