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 as je

instance = je.instance()
parsed = instance.parse("""
    PRINT("I have " + LEN(grades) + " students");
    PRINT("Alice's grade is " + grades.alice);
    grades
""")
symmap = instance.symmap({
    "grades" : {
        "alice"   : "A",
        "bob"     : "B",
        "charlie" : "B",
    }
})

result = parsed.eval(symmap)

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.2.4.tar.gz (81.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: jsonexpr-0.2.4.tar.gz
  • Upload date:
  • Size: 81.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for jsonexpr-0.2.4.tar.gz
Algorithm Hash digest
SHA256 4c93c7198c3aa24faa68e37fafe62186851bc3e34f544ee810e8e4526be6b2d5
MD5 eaa6661c65ccc96ef4b0925e607ee159
BLAKE2b-256 b7b14edfda49f4b8df91bc8bc769497e7708378022b8b7226f9f379725e1788a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page