Python implementation of the RapidPro expression and templating system
Project description
RapidPro Expressions
====================
Python implementation of the RapidPro expression and templating system.
Usage
-----
```python
context = new EvaluationContext()
context.put_variable("name", "bob jones")
evaluator = Evaluator()
output, errors = evaluator.evaluate_template("Hi @(PROPER(name))", context, False)
assert output == "Hi Bob Jones"
assert len(errors) == 0
```
Development
-----------
If you make changes to the grammar file _Excellent.g4_ you need to generate new lexer and parser python modules
1. Ensure you have the ANTLR command line tools installed.
2. Run _gen_parser.sh_
====================
Python implementation of the RapidPro expression and templating system.
Usage
-----
```python
context = new EvaluationContext()
context.put_variable("name", "bob jones")
evaluator = Evaluator()
output, errors = evaluator.evaluate_template("Hi @(PROPER(name))", context, False)
assert output == "Hi Bob Jones"
assert len(errors) == 0
```
Development
-----------
If you make changes to the grammar file _Excellent.g4_ you need to generate new lexer and parser python modules
1. Ensure you have the ANTLR command line tools installed.
2. Run _gen_parser.sh_
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
Built Distribution
Close
Hashes for rapidpro-expressions-1.1.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e24851e38a18de678980a843b446b0fb31fbc6f0d55485eb7136e7658918d4 |
|
MD5 | 3ecec5f7499079e86f573e49133e821e |
|
BLAKE2b-256 | 93fb1207d5034895d8ebcf76143bcc9853e33561d2659ede194428ed797b13ae |
Close
Hashes for rapidpro_expressions-1.1.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ec0b7227e942b96bb32bb181d5b32ed3344d8a957a5316681a814ae61cdaff5 |
|
MD5 | 444a6ec3ae3fd4428c4b2c39eb8da110 |
|
BLAKE2b-256 | dc4fb33fe1debebcd9a1d5bac956544f2f7c6cfb67e043e4e4d6c260f7cacdd2 |